diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-05-10 00:47:20 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-05-10 00:47:20 -0400 |
commit | 02c02a55eeeb744108d6a8335f6203a95ea20626 (patch) | |
tree | b6b7b6126c6077632114095d2bdeea937d47e4be /src/SMAPI/Framework/Logging | |
parent | 5a2755bfcc516345800a4e9b966a0aff435215b8 (diff) | |
download | SMAPI-02c02a55eeeb744108d6a8335f6203a95ea20626.tar.gz SMAPI-02c02a55eeeb744108d6a8335f6203a95ea20626.tar.bz2 SMAPI-02c02a55eeeb744108d6a8335f6203a95ea20626.zip |
generalise console color logic for reuse (#495)
Diffstat (limited to 'src/SMAPI/Framework/Logging')
-rw-r--r-- | src/SMAPI/Framework/Logging/ConsoleInterceptionManager.cs | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/SMAPI/Framework/Logging/ConsoleInterceptionManager.cs b/src/SMAPI/Framework/Logging/ConsoleInterceptionManager.cs index b8f2c34e..c04bcd1a 100644 --- a/src/SMAPI/Framework/Logging/ConsoleInterceptionManager.cs +++ b/src/SMAPI/Framework/Logging/ConsoleInterceptionManager.cs @@ -15,9 +15,6 @@ namespace StardewModdingAPI.Framework.Logging /********* ** Accessors *********/ - /// <summary>Whether the current console supports color formatting.</summary> - public bool SupportsColor { get; } - /// <summary>The event raised when a message is written to the console directly.</summary> public event Action<string> OnMessageIntercepted; @@ -32,9 +29,6 @@ namespace StardewModdingAPI.Framework.Logging this.Output = new InterceptingTextWriter(Console.Out); this.Output.OnMessageIntercepted += line => this.OnMessageIntercepted?.Invoke(line); Console.SetOut(this.Output); - - // test color support - this.SupportsColor = this.TestColorSupport(); } /// <summary>Get an exclusive lock and write to the console output without interception.</summary> @@ -61,26 +55,5 @@ namespace StardewModdingAPI.Framework.Logging Console.SetOut(this.Output.Out); this.Output.Dispose(); } - - - /********* - ** private methods - *********/ - /// <summary>Test whether the current console supports color formatting.</summary> - private bool TestColorSupport() - { - try - { - this.ExclusiveWriteWithoutInterception(() => - { - Console.ForegroundColor = Console.ForegroundColor; - }); - return true; - } - catch (Exception) - { - return false; // Mono bug - } - } } } |