Aspects.Logging.Loggers.ConsoleLogger.Error C# (CSharp) 메소드

Error() 공개 메소드

Logs the message and exception with error level.
public Error ( string message, Exception exception ) : void
message string The message.
exception System.Exception The exception.
리턴 void
        public void Error(string message, Exception exception)
        {
            ConsoleColor color = Console.ForegroundColor;
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine(message);
            Console.WriteLine(exception);
            Console.ForegroundColor = color;
        }

Usage Example

예제 #1
0
        public void WhenCallingErrorShouldEnterErrorMethod()
        {
            ConsoleLogger logger = new ConsoleLogger();

            logger.Error("Test String", new Exception());
        }