mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-05 00:20:08 +00:00
Code cleanup
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="NLog" publicKeyToken="5120e14c03d0593c" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="NLog" publicKeyToken="5120e14c03d0593c" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
|
||||
</configuration>
|
||||
@@ -31,6 +31,25 @@ namespace ArchiSteamFarm {
|
||||
internal static class Logging {
|
||||
private const string GeneralLayout = @"${date:format=yyyy-MM-dd HH\:mm\:ss}|${processname}-${processid}|${level:uppercase=true}|${logger}|${message}${onexception:inner= ${exception:format=toString,Data}}";
|
||||
|
||||
internal static void InitFormLogger() {
|
||||
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();
|
||||
}
|
||||
|
||||
internal static void InitLoggers() {
|
||||
if (LogManager.Configuration != null) {
|
||||
// User provided custom NLog config, or we have it set already, so don't override it
|
||||
@@ -58,24 +77,5 @@ namespace ArchiSteamFarm {
|
||||
|
||||
LogManager.Configuration = config;
|
||||
}
|
||||
|
||||
internal static void InitFormLogger() {
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -1,16 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<packages>
|
||||
<package id="Costura.Fody" version="2.0.0-beta0018" targetFramework="net461" developmentDependency="true" />
|
||||
<package id="Fody" version="1.30.0-beta01" targetFramework="net461" developmentDependency="true" />
|
||||
<package id="HtmlAgilityPack" version="1.4.9.5" targetFramework="net461" />
|
||||
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net461" />
|
||||
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net461" />
|
||||
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net461" />
|
||||
<package id="Newtonsoft.Json" version="9.0.2-beta2" targetFramework="net461" />
|
||||
<package id="Nito.AsyncEx" version="4.0.1" targetFramework="net461" />
|
||||
<package id="NLog" version="5.0.0-beta06" targetFramework="net461" />
|
||||
<package id="NLog.Windows.Forms" version="4.2.3" targetFramework="net461" />
|
||||
<package id="protobuf-net" version="2.0.0.668" targetFramework="net461" />
|
||||
<package id="Resource.Embedder" version="1.2.2" targetFramework="net461" developmentDependency="true" />
|
||||
<package id="SteamKit2" version="1.8.1" targetFramework="net461" />
|
||||
<package id="Costura.Fody" version="2.0.0-beta0018" targetFramework="net461" developmentDependency="true" />
|
||||
<package id="Fody" version="1.30.0-beta01" targetFramework="net461" developmentDependency="true" />
|
||||
<package id="HtmlAgilityPack" version="1.4.9.5" targetFramework="net461" />
|
||||
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="net461" />
|
||||
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net461" />
|
||||
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="net461" />
|
||||
<package id="Newtonsoft.Json" version="9.0.2-beta2" targetFramework="net461" />
|
||||
<package id="Nito.AsyncEx" version="4.0.1" targetFramework="net461" />
|
||||
<package id="NLog" version="5.0.0-beta06" targetFramework="net461" />
|
||||
<package id="NLog.Windows.Forms" version="4.2.3" targetFramework="net461" />
|
||||
<package id="protobuf-net" version="2.0.0.668" targetFramework="net461" />
|
||||
<package id="Resource.Embedder" version="1.2.2" targetFramework="net461" developmentDependency="true" />
|
||||
<package id="SteamKit2" version="1.8.1" targetFramework="net461" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user