design-patterns/Facade/BadLogger.cs
2023-09-04 10:17:26 +01:00

14 lines
No EOL
379 B
C#

public class BadLogger
{
public void Log(string message, LogType logType, Exception? ex)
{
Console.WriteLine($"{DateTime.UtcNow:s} [{logType.ToString().ToUpper()}] {message}");
if (ex != null)
{
Console.WriteLine("Exception:");
Console.WriteLine(ex.Message);
Console.WriteLine(ex.StackTrace);
}
}
}