1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-17 11:23:00 +00:00

Initial commit

This commit is contained in:
JKorf
2018-02-28 13:53:29 +01:00
parent e2af98f2c9
commit 2bf860947a
23 changed files with 837 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
using System.Diagnostics;
using System.IO;
using System.Text;
namespace CryptoExchange.Net.Logging
{
public class DebugTextWriter: TextWriter
{
public override Encoding Encoding => Encoding.ASCII;
public override void WriteLine(string value)
{
Debug.WriteLine(value);
}
}
}
+25
View File
@@ -0,0 +1,25 @@
using System;
using System.IO;
namespace CryptoExchange.Net.Logging
{
public class Log
{
public TextWriter TextWriter { get; internal set; } = new DebugTextWriter();
public LogVerbosity Level { get; internal set; } = LogVerbosity.Warning;
public void Write(LogVerbosity logType, string message)
{
if ((int)logType >= (int)Level)
TextWriter.WriteLine($"{DateTime.Now:hh:mm:ss:fff} | {logType} | {message}");
}
}
public enum LogVerbosity
{
Debug,
Warning,
Error,
None
}
}