Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions LibraryManagement.Api/Brokers/Loggings/ILoggingBroker.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//-----------------------------------------------------------
// Copyright (c) Coalition of Good-Hearted Engineers
// Free To Use To Build Reliable Library Management Solutions
//-----------------------------------------------------------

namespace LibraryManagement.Api.Brokers.Loggings
{
public interface ILoggingBroker
{
void LogError(Exception exception);
void LogCritical(Exception exception);
}
}
21 changes: 21 additions & 0 deletions LibraryManagement.Api/Brokers/Loggings/LoggingBroker.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//-----------------------------------------------------------
// Copyright (c) Coalition of Good-Hearted Engineers
// Free To Use To Build Reliable Library Management Solutions
//-----------------------------------------------------------

namespace LibraryManagement.Api.Brokers.Loggings
{
public class LoggingBroker : ILoggingBroker
{
private readonly ILogger<LoggingBroker> logger;

public LoggingBroker(ILogger<LoggingBroker> logger) =>
this.logger = logger;

public void LogError(Exception exception) =>
this.logger.LogError(exception, exception.Message);

public void LogCritical(Exception exception) =>
this.logger.LogCritical(exception, exception.Message);
}
}
Loading