51 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			51 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| using Core.Blueprint.DAL.Logs.Contracts;
 | |
| using Serilog;
 | |
| 
 | |
| namespace Core.Blueprint.DAL.Logs
 | |
| {
 | |
|     public class BlueprintSerilogLogger : IBlueprintSerilogLogger
 | |
|     {
 | |
|         private readonly ILogger logger;
 | |
| 
 | |
|         public BlueprintSerilogLogger(ILogger logger)
 | |
|         {
 | |
|             this.logger = logger;
 | |
|         }
 | |
| 
 | |
|         public void LogInformation(string service, params object[] args)
 | |
|         {
 | |
|             logger.Information("Starting operation in {service} service", service, args);
 | |
|         }
 | |
| 
 | |
|         public void LogOperationStarted(string service, params object[] args)
 | |
|         {
 | |
|             logger.Information("Starting operation in {Service} service with parameters: {@Args}", service, args);
 | |
|         }
 | |
|         public void LogOperationFinished(string service, params object[] args)
 | |
|         {
 | |
|             logger.Information("Finishing operation in {Service} service with parameters: {@Args}", service, args);
 | |
|         }
 | |
| 
 | |
|         public void LogInformation(string message)
 | |
|         {
 | |
|             logger.Information(message);
 | |
|         }
 | |
| 
 | |
|         public void LogWarning(string message, params object[] args)
 | |
|         {
 | |
|             logger.Warning(message, args);
 | |
|         }
 | |
| 
 | |
|         public void LogError(string service, params object[] args)
 | |
|         {
 | |
|             logger.Error("An error occurred in `{service}` Exception: {@Args}", service, args);
 | |
|         }
 | |
| 
 | |
|         public void LogCritical(Exception exception, string message, params object[] args)
 | |
|         {
 | |
|             logger.Fatal(exception, message, args);
 | |
|         }
 | |
|     }
 | |
| }
 | |
| 
 | 
