design-patterns/Facade/BadLogger.cs
2023-09-05 10:40:56 +01:00

14 lines
No EOL
397 B
C#

public class BadLogger
{
public void Log(string message, LogType logType, LogTarget target, 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);
}
}
}