-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathLoggerWrapper.cs
53 lines (46 loc) · 1.79 KB
/
LoggerWrapper.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
using System;
using System.Collections.Generic;
namespace Logging
{
public class LoggerWrapper : Contracts.ILogger
{
private readonly UsageLogger usageLogger;
private readonly ErrorLogger errorLogger;
private readonly InfoLogger infoLogger;
private readonly DiagnosticLogger diagnosticLogger;
private readonly PerformanceLogger performanceLogger;
public LoggerWrapper(
UsageLogger usageLogger,
ErrorLogger errorLogger,
InfoLogger infoLogger,
DiagnosticLogger diagnosticLogger,
PerformanceLogger performanceLogger)
{
this.usageLogger = usageLogger;
this.errorLogger = errorLogger;
this.infoLogger = infoLogger;
this.diagnosticLogger = diagnosticLogger;
this.performanceLogger = performanceLogger;
}
public void LogError(Exception exception, Dictionary<string, object> additionalInfo = null)
{
errorLogger.Log(exception, additionalInfo);
}
public void LogUsage(string activityName, Dictionary<string, object> additionalInfo = null)
{
usageLogger.Log(activityName, additionalInfo);
}
public void LogInfo(string message, Dictionary<string, object> additionalInfo = null)
{
infoLogger.Log(message, additionalInfo);
}
public void LogDiagnostic(string message, Dictionary<string, object> additionalInfo = null)
{
diagnosticLogger.Log(message, additionalInfo);
}
public void LogPerformance(string message, long? elapsedMilliseconds, Dictionary<string, object> additionalInfo = null)
{
performanceLogger.Log(message, elapsedMilliseconds, additionalInfo);
}
}
}