BetterExplorer.MainWindow.AddToLog C# (CSharp) Method

AddToLog() private method

private AddToLog ( string value ) : void
value string
return void
    private void AddToLog(string value) {
      try {
        if (canlogactions) {
          if (!Directory.Exists(logdir)) Directory.CreateDirectory(logdir);

          using (var sw = new StreamWriter($"{logdir}{sessionid}.txt", true)) {
            sw.WriteLine(DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString() + " : " + value);
          }
        }
      } catch (Exception exe) {
        MessageBox.Show("An error occurred while writing to the log file. This error can be avoided if you disable the action logging feature. Please report this issue at http://bugs.gainedge.org/public/betterexplorer. \r\n\r\n Here is some information about the error: \r\n\r\n" + exe.Message + "\r\n\r\n" + exe.ToString(), "Error While Writing to Log", MessageBoxButton.OK, MessageBoxImage.Error);
      }
    }
MainWindow