Update logging methods to use standard naming conventions
Replaced custom Warn method with LogWarning in Logger class and updated usage in FinalizeDocumentJob. Added LogInformation and LogWarning methods for consistency with common logging practices. LogWarning now accepts an Exception as the first parameter, aligning with standard logging signatures.
This commit is contained in:
@@ -196,7 +196,7 @@ public class FinalizeDocumentJob(IOptions<WorkerOptions> options, IConfiguration
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex);
|
||||
_logger.Warn(ex, "Unhandled exception while working envelope [{0}]", id);
|
||||
_logger.LogWarning(ex, "Unhandled exception while working envelope [{0}]", id);
|
||||
}
|
||||
|
||||
current += 1;
|
||||
|
||||
@@ -14,9 +14,13 @@ public class Logger
|
||||
ILogger<LogConfig> logger;
|
||||
|
||||
public void LogDebug(string message, params object?[] args) => Write("DEBUG", message, args);
|
||||
|
||||
public void LogInformation(string message, params object?[] args) => Write("INFO", message, args);
|
||||
|
||||
public void LogWarning(string message, params object?[] args) => Write("WARN", message, args);
|
||||
public void Warn(Exception exception, string message, params object?[] args) => Write("WARN", message + " " + exception.Message, args);
|
||||
|
||||
public void LogWarning(Exception exception, string message, params object?[] args) => Write("WARN", message + " " + exception.Message, args);
|
||||
|
||||
public void Error(Exception exception) => Write("ERROR", exception.Message, Array.Empty<object?>());
|
||||
public void Error(Exception exception, string message, params object?[] args) => Write("ERROR", message + " " + exception.Message, args);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user