-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathRavenDbLogLevelToLogsModeMapper.cs
More file actions
30 lines (29 loc) · 1.14 KB
/
RavenDbLogLevelToLogsModeMapper.cs
File metadata and controls
30 lines (29 loc) · 1.14 KB
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 ServiceControl
{
using Microsoft.Extensions.Logging;
public class RavenDbLogLevelToLogsModeMapper
{
public static string Map(string ravenDbLogLevel, ILogger logger)
{
switch (ravenDbLogLevel.ToLower())
{
case "off": // Backwards compatibility with 4.x
case "none":
return "None";
case "trace": // Backwards compatibility with 4.x
case "debug": // Backwards compatibility with 4.x
case "info": // Backwards compatibility with 4.x
case "information":
return "Information";
case "error": // Backwards compatibility with 4.x
case "warn": // Backwards compatibility with 4.x
case "fatal": // Backwards compatibility with 4.x
case "operations":
return "Operations";
default:
logger.LogWarning("Unknown log level '{RavenDbLogLevel}', mapped to 'Operations'", ravenDbLogLevel);
return "Operations";
}
}
}
}