Exemple #1
0
        public Task StandardLog(IStandardLog message)
        {
            StandardLog Message = new StandardLog(message.Severity, message.Source, message.Message, message.Exception);

            PrintLog(Message);
            return(Task.CompletedTask);
        }
Exemple #2
0
        private void PrintLog(IStandardLog message)
        {
            switch (message.Severity)
            {
            case LogSeverity.Critical:
            case LogSeverity.Error:
                Console.ForegroundColor = ConsoleColor.Red;
                break;

            case LogSeverity.Warning:
                Console.ForegroundColor = ConsoleColor.Yellow;
                break;

            case LogSeverity.Info:
                Console.ForegroundColor = ConsoleColor.White;
                break;

            case LogSeverity.Verbose:
            case LogSeverity.Debug:
                Console.ForegroundColor = ConsoleColor.DarkGray;
                break;
            }
            Console.WriteLine($"{DateTime.Now,-19} [{message.Severity,8}] {message.Source}: {message.Message} {message.Exception}");
            Console.ResetColor();
        }
Exemple #3
0
 void Awake()
 {
     this.log = LogManager.GetCurrentClassLogger(this.name);
 }