forked from fifonik/FFBitrateViewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLog.cs
46 lines (33 loc) · 1.01 KB
/
Log.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
namespace FFBitrateViewer
{
public static class Log
{
private static Logger? Logger = null;
public static bool IsLogCommands = false;
public static void Init(Logger logger, bool isLogCommands = false)
{
Logger = logger;
IsLogCommands = isLogCommands;
}
public static void Close()
{
Logger?.Close();
}
public static bool LogLevelIs(LogLevel logLevel)
{
return Logger?.GetMinLevel() == logLevel;
}
public static void Write(LogLevel logLevel, string line)
{
Logger?.Log(logLevel, line);
}
public static void Write(LogLevel logLevel, params string[] values)
{
Write(logLevel, string.Join(", ", values));
}
public static void WriteCommand(string executable, string? args)
{
if(IsLogCommands) Write(LogLevel.INFO, executable + " " + args);
}
}
}