@@ -5,7 +5,7 @@ namespace algorithm_exercises_csharp;
5
5
6
6
public sealed class LoggerSingleton
7
7
{
8
- private static readonly Lazy < LoggerSingleton > _instance = new Lazy < LoggerSingleton > ( ( ) => new LoggerSingleton ( ) ) ;
8
+ private static readonly Lazy < LoggerSingleton > _instance = new ( ( ) => new LoggerSingleton ( ) ) ;
9
9
10
10
public static LoggerSingleton Instance => _instance . Value ;
11
11
@@ -26,7 +26,7 @@ private LoggerSingleton()
26
26
{
27
27
builder
28
28
. AddConsole ( )
29
- . SetMinimumLevel ( logLevel ) ; // Configura el nivel mínimo de logging
29
+ . SetMinimumLevel ( logLevel ) ; // set minimum logging level
30
30
} ) ;
31
31
32
32
Logger = loggerFactory . CreateLogger ( "GlobalLogger" ) ;
@@ -47,23 +47,31 @@ public static ILogger getLogger()
47
47
return LoggerSingleton . Instance . Logger ;
48
48
}
49
49
50
- public static void info ( string message )
50
+ public static void info ( string message , params object ? [ ] args )
51
51
{
52
- LoggerSingleton . Instance . Logger . LogInformation ( message ) ;
52
+ #pragma warning disable CA2254 // Template should be a static expression
53
+ LoggerSingleton . Instance . Logger . LogInformation ( message , args ) ;
54
+ #pragma warning restore CA2254 // Template should be a static expression
53
55
}
54
56
55
- public static void warning ( string message )
57
+ public static void warning ( string message , params object ? [ ] args )
56
58
{
59
+ #pragma warning disable CA2254 // Template should be a static expression
57
60
LoggerSingleton . Instance . Logger . LogWarning ( message ) ;
61
+ #pragma warning restore CA2254 // Template should be a static expression
58
62
}
59
63
60
- public static void error ( string message )
64
+ public static void error ( string message , params object ? [ ] args )
61
65
{
66
+ #pragma warning disable CA2254 // Template should be a static expression
62
67
LoggerSingleton . Instance . Logger . LogError ( message ) ;
68
+ #pragma warning restore CA2254 // Template should be a static expression
63
69
}
64
70
65
- public static void debug ( string message )
71
+ public static void debu ( string message , params object ? [ ] args )
66
72
{
73
+ #pragma warning disable CA2254 // Template should be a static expression
67
74
LoggerSingleton . Instance . Logger . LogDebug ( message ) ;
75
+ #pragma warning restore CA2254 // Template should be a static expression
68
76
}
69
77
}
0 commit comments