-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLogger.cs
30 lines (27 loc) · 903 Bytes
/
Logger.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
namespace YuchikiML {
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System;
public static class Logger {
public enum ErrorLevel {
Error = 10,
Warn = 20,
Info = 30,
Trace = 40
}
public static ErrorLevel Criteria = ErrorLevel.Info;
public static void LogTrace(string str) {
if (ErrorLevel.Trace <= Criteria) Console.Error.WriteLine(str);
}
public static void LogInfo(string str) {
if (ErrorLevel.Info <= Criteria) Console.Error.WriteLine(str);
}
public static void LogWarn(string str) {
if (ErrorLevel.Warn <= Criteria) Console.Error.WriteLine(str);
}
public static void LogError(string str) {
if (ErrorLevel.Error <= Criteria) Console.Error.WriteLine(str);
}
}
}