design-patterns/Facade/Logger.cs

23 lines
549 B
C#
Raw Normal View History

2023-09-04 09:17:26 +00:00
public class Logger : ILogger
{
2023-09-07 12:41:04 +00:00
private readonly IBadLogger _logger;
2023-09-04 09:17:26 +00:00
public Logger()
{
_logger = new BadLogger();
}
public void Information(string message)
{
2023-09-05 09:40:56 +00:00
_logger.Log(message, LogType.Info, LogTarget.Console, null);
2023-09-04 09:17:26 +00:00
}
public void Error(string message, Exception? ex = null)
{
2023-09-05 09:40:56 +00:00
_logger.Log(message, LogType.Error, LogTarget.Console, ex);
2023-09-04 09:17:26 +00:00
}
public void Fatal(string message, Exception? ex = null)
{
2023-09-05 09:40:56 +00:00
_logger.Log(message, LogType.Fatal, LogTarget.Console, ex);
2023-09-04 09:17:26 +00:00
}
}