-
Notifications
You must be signed in to change notification settings - Fork 13
/
LoggerFacade.cs
executable file
·62 lines (51 loc) · 1.58 KB
/
LoggerFacade.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// (C) 2012 christian.schladetsch@gmail.com See https://github.com/cschladetsch/Flow.
namespace Flow {
/// <summary>
/// DOC
/// </summary>
/// <typeparam name="TLogger"></typeparam>
public class LoggerFacade<TLogger>
: ILogger where TLogger
: class
, ILogger
, new() {
private readonly TLogger _log = new TLogger();
public LoggerFacade(string pre) {
_log.LogPrefix = pre;
_log.ShowStack = false;
_log.ShowSource = true;
}
public string LogPrefix {
get => _log.LogPrefix;
set => _log.LogPrefix = value;
}
public object LogSubject {
get => _log.LogSubject;
set => _log.LogSubject = value;
}
public bool ShowSource {
get => _log.ShowSource;
set => _log.ShowSource = value;
}
public bool ShowStack {
get => _log.ShowStack;
set => _log.ShowStack = value;
}
public int Verbosity {
get => _log.Verbosity;
set => _log.Verbosity = value;
}
public void Info(string fmt, params object[] args) {
_log.Info(fmt, args);
}
public void Warn(string fmt, params object[] args) {
_log.Warn(fmt, args);
}
public void Error(string fmt, params object[] args) {
_log.Error(fmt, args);
}
public void Verbose(int level, string fmt, params object[] args) {
_log.Verbose(level, fmt, args);
}
}
}