From c812dd67bf0c72432566b6478063fdddaab64eed Mon Sep 17 00:00:00 2001 From: Anairkoen Schno Date: Fri, 26 Mar 2021 21:28:12 -0500 Subject: [PATCH] Changed default options to not emit log files for every plugin seperately --- IPA.Loader/Config/SelfConfig.cs | 13 +++++++++++-- IPA.Loader/Logging/StandardLogger.cs | 5 +++-- docs/articles/command-line.md | 12 +++++------- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/IPA.Loader/Config/SelfConfig.cs b/IPA.Loader/Config/SelfConfig.cs index 29c18526..bfa06496 100644 --- a/IPA.Loader/Config/SelfConfig.cs +++ b/IPA.Loader/Config/SelfConfig.cs @@ -56,6 +56,9 @@ namespace IPA.Config case "--condense-logs": CommandLineValues.Debug.CondenseModLogs = true; break; + case "--plugin-logs": + CommandLineValues.Debug.CreateModLogs = true; + break; #if false case "--no-updates": CommandLineValues.Updates.AutoCheckUpdates = false; @@ -117,6 +120,12 @@ namespace IPA.Config public static bool CondenseModLogs_ => (Instance?.Debug?.CondenseModLogs ?? false) || CommandLineValues.Debug.CondenseModLogs; + // This option only takes effect after a full game restart, unless new logs are created again + public virtual bool CreateModLogs { get; set; } = false; + // LINE: ignore 2 + public static bool CreateModLogs_ => (Instance?.Debug?.CreateModLogs ?? false) + || CommandLineValues.Debug.CreateModLogs; + public virtual bool ShowHandledErrorStackTraces { get; set; } = false; // LINE: ignore public static bool ShowHandledErrorStackTraces_ => Instance?.Debug?.ShowHandledErrorStackTraces ?? false; @@ -164,9 +173,9 @@ namespace IPA.Config // LINE: ignore public static HashSet GameAssemblies_ => Instance?.GameAssemblies ?? new HashSet { "Assembly-CSharp.dll" }; - [JsonProperty(Required = Required.DisallowNull)] // Used for documentation schema generation // LINE: ignore -#if false +#if false // Used for documentation schema generation + [JsonProperty(Required = Required.DisallowNull)] public virtual string LastGameVersion { get; set; } = null; // LINE: ignore 2 #endif diff --git a/IPA.Loader/Logging/StandardLogger.cs b/IPA.Loader/Logging/StandardLogger.cs index 1edd8c58..72a5b3c3 100644 --- a/IPA.Loader/Logging/StandardLogger.cs +++ b/IPA.Loader/Logging/StandardLogger.cs @@ -131,7 +131,7 @@ namespace IPA.Logging logName = $"{parent.logName}/{subName}"; this.parent = parent; printers = new List(); - if (!SelfConfig.Debug_.CondenseModLogs_) + if (SelfConfig.Debug_.CreateModLogs_ && !SelfConfig.Debug_.CondenseModLogs_) printers.Add(new PluginSubLogPrinter(parent.logName, subName)); if (logThread == null || !logThread.IsAlive) @@ -153,7 +153,8 @@ namespace IPA.Logging } logName = name; - printers.Add(new PluginLogFilePrinter(name)); + if (SelfConfig.Debug_.CreateModLogs_) + printers.Add(new PluginLogFilePrinter(name)); if (logThread == null || !logThread.IsAlive) { diff --git a/docs/articles/command-line.md b/docs/articles/command-line.md index 74a917a3..ea3e846c 100644 --- a/docs/articles/command-line.md +++ b/docs/articles/command-line.md @@ -83,15 +83,13 @@ Here's a quick list of what they are and what they do. > that behaviour, and restricts it to only create a global log and mod logs. > > Overrides the config setting `Debug.CondenseModLogs`. - > -- `--no-updates` - > Disables automatic updating. - > - > By default, BSIPA will check [BeatMods](http://beatmods.com) for all of the loaded mods to see if there is a new version - > avaliable. If there is, it will be downloaded and installed on the next run. This flag disables that behaviour. +- `--plugin-logs` + + > Causes each plugins' log messages to be written to files in their own folder for ease of debugging. > - > Overrides the config settings `Updates.AutoCheckUpdates` and `Updates.AutoUpdate`. + > This was the default through 4.1.6, however is now disabled by default. > + > Overrides the config setting `Debug.CreateModLogs`. ***