diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-07-03 14:26:45 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-07-03 14:26:45 -0400 |
commit | 18e5e42529e13f21553651014a93c0f48cd93a59 (patch) | |
tree | 642eea265b07ad61909e50c60b2f0740ba3a8302 /src/StardewModdingAPI/Framework/Monitor.cs | |
parent | 0f05e7bd54823750d6ccd153ec929e831b51f426 (diff) | |
download | SMAPI-18e5e42529e13f21553651014a93c0f48cd93a59.tar.gz SMAPI-18e5e42529e13f21553651014a93c0f48cd93a59.tar.bz2 SMAPI-18e5e42529e13f21553651014a93c0f48cd93a59.zip |
defer some console changes until SMAPI 2.0
Diffstat (limited to 'src/StardewModdingAPI/Framework/Monitor.cs')
-rw-r--r-- | src/StardewModdingAPI/Framework/Monitor.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/StardewModdingAPI/Framework/Monitor.cs b/src/StardewModdingAPI/Framework/Monitor.cs index 64cc0bdc..6359b454 100644 --- a/src/StardewModdingAPI/Framework/Monitor.cs +++ b/src/StardewModdingAPI/Framework/Monitor.cs @@ -45,8 +45,10 @@ namespace StardewModdingAPI.Framework /// <summary>Whether SMAPI is aborting. Mods don't need to worry about this unless they have background tasks.</summary> public bool IsExiting => this.ExitTokenSource.IsCancellationRequested; +#if SMAPI_2_0 /// <summary>Whether to show the full log stamps (with time/level/logger) in the console. If false, shows a simplified stamp with only the logger.</summary> internal bool ShowFullStampInConsole { get; set; } +#endif /// <summary>Whether to show trace messages in the console.</summary> internal bool ShowTraceInConsole { get; set; } @@ -95,6 +97,7 @@ namespace StardewModdingAPI.Framework this.ExitTokenSource.Cancel(); } +#if SMAPI_2_0 /// <summary>Write a newline to the console and log file.</summary> internal void Newline() { @@ -103,6 +106,7 @@ namespace StardewModdingAPI.Framework if (this.WriteToFile) this.LogFile.WriteLine(""); } +#endif #if !SMAPI_2_0 /// <summary>Log a message for the player or developer, using the specified console color.</summary> @@ -140,7 +144,11 @@ namespace StardewModdingAPI.Framework string levelStr = level.ToString().ToUpper().PadRight(Monitor.MaxLevelLength); string fullMessage = $"[{DateTime.Now:HH:mm:ss} {levelStr} {source}] {message}"; +#if SMAPI_2_0 string consoleMessage = this.ShowFullStampInConsole ? fullMessage : $"[{source}] {message}"; +#else + string consoleMessage = fullMessage; +#endif // write to console if (this.WriteToConsole && (this.ShowTraceInConsole || level != LogLevel.Trace)) |