diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2016-12-30 12:04:27 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2016-12-30 12:04:27 -0500 |
commit | a432477ea31c32e62fb347aef75861ab7ef62510 (patch) | |
tree | df2fe7258d7748ce829222633844a3f00e94302e /src/StardewModdingAPI/Framework | |
parent | a7d3930d88b3f3b73c8f614372fcb839b3b5c5ad (diff) | |
download | SMAPI-a432477ea31c32e62fb347aef75861ab7ef62510.tar.gz SMAPI-a432477ea31c32e62fb347aef75861ab7ef62510.tar.bz2 SMAPI-a432477ea31c32e62fb347aef75861ab7ef62510.zip |
fallback to launching SMAPI without a terminal on Linux if the terminal is unavailable (#198)
Diffstat (limited to 'src/StardewModdingAPI/Framework')
-rw-r--r-- | src/StardewModdingAPI/Framework/Monitor.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/StardewModdingAPI/Framework/Monitor.cs b/src/StardewModdingAPI/Framework/Monitor.cs index cf46a474..0989bb7e 100644 --- a/src/StardewModdingAPI/Framework/Monitor.cs +++ b/src/StardewModdingAPI/Framework/Monitor.cs @@ -37,6 +37,9 @@ namespace StardewModdingAPI.Framework /// <summary>Whether to show trace messages in the console.</summary> internal bool ShowTraceInConsole { get; set; } + /// <summary>Whether to write anything to the console. This should be disabled if no console is available.</summary> + internal bool WriteToConsole { get; set; } = true; + /********* ** Public methods @@ -108,7 +111,7 @@ namespace StardewModdingAPI.Framework message = $"[{DateTime.Now:HH:mm:ss} {levelStr} {source}] {message}"; // log - if (this.ShowTraceInConsole || level != LogLevel.Trace) + if (this.WriteToConsole && (this.ShowTraceInConsole || level != LogLevel.Trace)) { Console.ForegroundColor = color; Console.WriteLine(message); |