diff options
Diffstat (limited to 'Tools/Hazel-Networking/Hazel.UnitTests/TestLogger.cs')
-rw-r--r-- | Tools/Hazel-Networking/Hazel.UnitTests/TestLogger.cs | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/Tools/Hazel-Networking/Hazel.UnitTests/TestLogger.cs b/Tools/Hazel-Networking/Hazel.UnitTests/TestLogger.cs new file mode 100644 index 0000000..01ca893 --- /dev/null +++ b/Tools/Hazel-Networking/Hazel.UnitTests/TestLogger.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Hazel.UnitTests +{ + public class TestLogger : ILogger + { + private readonly string prefix; + + public TestLogger(string prefix = "") + { + this.prefix = prefix; + } + + public void WriteVerbose(string msg) + { + if (string.IsNullOrEmpty(this.prefix)) + { + Console.WriteLine($"[VERBOSE] {msg}"); + } + else + { + Console.WriteLine($"[{this.prefix}][VERBOSE] {msg}"); + } + } + + public void WriteWarning(string msg) + { + if (string.IsNullOrEmpty(this.prefix)) + { + Console.WriteLine($"[WARN] {msg}"); + } + else + { + Console.WriteLine($"[{this.prefix}][WARN] {msg}"); + } + } + + public void WriteError(string msg) + { + if (string.IsNullOrEmpty(this.prefix)) + { + Console.WriteLine($"[ERROR] {msg}"); + } + else + { + Console.WriteLine($"[{this.prefix}][ERROR] {msg}"); + } + } + + public void WriteInfo(string msg) + { + if (string.IsNullOrEmpty(this.prefix)) + { + Console.WriteLine($"[INFO] {msg}"); + } + else + { + Console.WriteLine($"[{this.prefix}][INFO] {msg}"); + } + } + } +} |