Browse Source

Added --no-logs launch argument

pull/85/head
Kinsi 2 years ago
committed by GitHub
parent
commit
9d528245e2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions
  1. +6
    -0
      IPA.Loader/Config/SelfConfig.cs
  2. +6
    -4
      IPA.Loader/Logging/StandardLogger.cs

+ 6
- 0
IPA.Loader/Config/SelfConfig.cs View File

@ -53,6 +53,9 @@ namespace IPA.Config
case "--no-yeet":
CommandLineValues.YeetMods = false;
break;
case "--no-logs":
CommandLineValues.WriteLogs = true;
break;
case "--condense-logs":
CommandLineValues.Debug.CondenseModLogs = true;
break;
@ -174,6 +177,9 @@ namespace IPA.Config
public static bool YeetMods_ => (Instance?.YeetMods ?? true)
&& CommandLineValues.YeetMods;
[JsonIgnore]
public bool WriteLogs { get; set; } = true;
// LINE: ignore
[NonNullable, UseConverter(typeof(CollectionConverter<string, HashSet<string?>>))]
public virtual HashSet<string> GameAssemblies { get; set; } = new HashSet<string>


+ 6
- 4
IPA.Loader/Logging/StandardLogger.cs View File

@ -25,10 +25,7 @@ namespace IPA.Logging
/// </remarks>
public class StandardLogger : Logger
{
private static readonly List<LogPrinter> defaultPrinters = new()
{
new GlobalLogFilePrinter()
};
private static readonly List<LogPrinter> defaultPrinters = new();
static StandardLogger()
{
@ -115,6 +112,7 @@ namespace IPA.Logging
private readonly Dictionary<string, StandardLogger> children = new();
private static bool addedFilePrinter = false;
/// <summary>
/// Configures internal debug settings based on the config passed in.
/// </summary>
@ -124,6 +122,10 @@ namespace IPA.Logging
PrintFilter = SelfConfig.Debug_.ShowDebug_ ? LogLevel.All : LogLevel.InfoUp;
showTrace = SelfConfig.Debug_.ShowTrace_;
syncLogging = SelfConfig.Debug_.SyncLogging_;
if(SelfConfig.CommandLineValues.WriteLogs && !addedFilePrinter) {
addedFilePrinter = true;
AddDefaultPrinter(new GZFilePrinter());
}
}
private StandardLogger(StandardLogger parent, string subName)


Loading…
Cancel
Save