Browse Source

Merge pull request #85 from kinsi55/master

Added --no-logs launch argument
pull/86/head
nike4613 1 year ago
committed by GitHub
parent
commit
3fa908a557
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 5 deletions
  1. +6
    -0
      IPA.Loader/Config/SelfConfig.cs
  2. +8
    -5
      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>


+ 8
- 5
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,11 @@ 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 GlobalLogFilePrinter());
}
}
private StandardLogger(StandardLogger parent, string subName)
@ -457,4 +460,4 @@ namespace IPA.Logging
_ => throw new InvalidOperationException()
};
}
}
}

Loading…
Cancel
Save