Gigantic code cleanup

Time to enforce some common file layout, as general mess started to annoying me. Sorry in advance for people using custom forks and having merge conflicts, this will help everybody in long-run
This commit is contained in:
JustArchi
2016-11-24 07:32:16 +01:00
parent 1a49c80bc4
commit df218074ad
65 changed files with 4299 additions and 4356 deletions

View File

@@ -29,6 +29,7 @@ using NLog.Targets;
using NLog.Windows.Forms;
// ReSharper disable once CheckNamespace
namespace ArchiSteamFarm {
internal static class Logging {
private const string GeneralLayout = @"${date:format=yyyy-MM-dd HH\:mm\:ss} | ${level:uppercase=true} | ${logger} | ${message}${onexception:inner= | ${exception:format=toString,Data}}";
@@ -46,10 +47,7 @@ namespace ArchiSteamFarm {
}
}
MessageBoxTarget messageBoxTarget = new MessageBoxTarget {
Name = "MessageBox",
Layout = GeneralLayout
};
MessageBoxTarget messageBoxTarget = new MessageBoxTarget { Name = "MessageBox", Layout = GeneralLayout };
LogManager.Configuration.AddTarget(messageBoxTarget);
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Fatal, messageBoxTarget));
@@ -61,11 +59,7 @@ namespace ArchiSteamFarm {
return;
}
FileTarget fileTarget = new FileTarget("File") {
DeleteOldFileOnStartup = true,
FileName = SharedInfo.LogFile,
Layout = GeneralLayout
};
FileTarget fileTarget = new FileTarget("File") { DeleteOldFileOnStartup = true, FileName = SharedInfo.LogFile, Layout = GeneralLayout };
LogManager.Configuration.AddTarget(fileTarget);
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Debug, fileTarget));
@@ -74,23 +68,15 @@ namespace ArchiSteamFarm {
}
internal static void InitFormLogger() {
RichTextBoxTarget formControlTarget = new RichTextBoxTarget {
AutoScroll = true,
ControlName = "LogTextBox",
FormName = "MainForm",
Layout = GeneralLayout,
MaxLines = byte.MaxValue,
Name = "RichTextBox"
};
RichTextBoxTarget formControlTarget = new RichTextBoxTarget { AutoScroll = true, ControlName = "LogTextBox", FormName = "MainForm", Layout = GeneralLayout, MaxLines = byte.MaxValue, Name = "RichTextBox" };
formControlTarget.RowColoringRules.Add(new RichTextBoxRowColoringRule("level >= LogLevel.Error", "Red", "Black"));
formControlTarget.RowColoringRules.Add(new RichTextBoxRowColoringRule("level >= LogLevel.Warn", "Yellow", "Black"));
LogManager.Configuration.AddTarget(formControlTarget);
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Debug, formControlTarget));
LogManager.ReconfigExistingLoggers();
}
}
}
}