|
3 | 3 |
|
4 | 4 | namespace Microsoft.Extensions.Logging |
5 | 5 | { |
6 | | - internal class LambdaILogger : ILogger |
7 | | - { |
8 | | - // Private fields |
9 | | - private readonly string _categoryName; |
10 | | - private readonly LambdaLoggerOptions _options; |
| 6 | + internal class LambdaILogger : ILogger |
| 7 | + { |
| 8 | + // Private fields |
| 9 | + private readonly string _categoryName; |
| 10 | + private readonly LambdaLoggerOptions _options; |
11 | 11 |
|
12 | 12 |
|
13 | | - internal IExternalScopeProvider ScopeProvider { get; set; } |
| 13 | + internal IExternalScopeProvider ScopeProvider { get; set; } |
14 | 14 |
|
15 | | - // Constructor |
16 | | - public LambdaILogger(string categoryName, LambdaLoggerOptions options) |
17 | | - { |
18 | | - _categoryName = categoryName; |
19 | | - _options = options; |
20 | | - } |
| 15 | + // Constructor |
| 16 | + public LambdaILogger(string categoryName, LambdaLoggerOptions options) |
| 17 | + { |
| 18 | + _categoryName = categoryName; |
| 19 | + _options = options; |
| 20 | + } |
21 | 21 |
|
22 | | - // ILogger methods |
23 | | - public IDisposable BeginScope<TState>(TState state) => ScopeProvider?.Push(state) ?? new NoOpDisposable(); |
| 22 | + // ILogger methods |
| 23 | + public IDisposable BeginScope<TState>(TState state) => ScopeProvider?.Push(state) ?? new NoOpDisposable(); |
24 | 24 |
|
25 | | - public bool IsEnabled(LogLevel logLevel) |
26 | | - { |
27 | | - return ( |
28 | | - _options.Filter == null || |
29 | | - _options.Filter(_categoryName, logLevel)); |
30 | | - } |
| 25 | + public bool IsEnabled(LogLevel logLevel) |
| 26 | + { |
| 27 | + return ( |
| 28 | + _options.Filter == null || |
| 29 | + _options.Filter(_categoryName, logLevel)); |
| 30 | + } |
31 | 31 |
|
32 | 32 | /// <summary> |
33 | 33 | /// The Log method called by the ILogger framework to log message to logger's target. In the Lambda case the formatted logging will be |
@@ -108,33 +108,33 @@ private static Amazon.Lambda.Core.LogLevel ConvertLogLevel(LogLevel logLevel) |
108 | 108 | } |
109 | 109 | } |
110 | 110 |
|
111 | | - private void GetScopeInformation(List<string> logMessageComponents) |
112 | | - { |
113 | | - var scopeProvider = ScopeProvider; |
| 111 | + private void GetScopeInformation(List<string> logMessageComponents) |
| 112 | + { |
| 113 | + var scopeProvider = ScopeProvider; |
114 | 114 |
|
115 | | - if (_options.IncludeScopes && scopeProvider != null) |
116 | | - { |
117 | | - var initialCount = logMessageComponents.Count; |
| 115 | + if (_options.IncludeScopes && scopeProvider != null) |
| 116 | + { |
| 117 | + var initialCount = logMessageComponents.Count; |
118 | 118 |
|
119 | | - scopeProvider.ForEachScope((scope, list) => |
120 | | - { |
121 | | - list.Add(scope.ToString()); |
122 | | - }, (logMessageComponents)); |
| 119 | + scopeProvider.ForEachScope((scope, list) => |
| 120 | + { |
| 121 | + list.Add(scope.ToString()); |
| 122 | + }, (logMessageComponents)); |
123 | 123 |
|
124 | | - if (logMessageComponents.Count > initialCount) |
125 | | - { |
126 | | - logMessageComponents.Add("=>"); |
127 | | - } |
128 | | - } |
129 | | - } |
| 124 | + if (logMessageComponents.Count > initialCount) |
| 125 | + { |
| 126 | + logMessageComponents.Add("=>"); |
| 127 | + } |
| 128 | + } |
| 129 | + } |
130 | 130 |
|
131 | | - // Private classes |
132 | | - private class NoOpDisposable : IDisposable |
133 | | - { |
134 | | - public void Dispose() |
135 | | - { |
136 | | - } |
137 | | - } |
| 131 | + // Private classes |
| 132 | + private class NoOpDisposable : IDisposable |
| 133 | + { |
| 134 | + public void Dispose() |
| 135 | + { |
| 136 | + } |
| 137 | + } |
138 | 138 |
|
139 | | - } |
| 139 | + } |
140 | 140 | } |
0 commit comments