public Task StandardLog(IStandardLog message) { StandardLog Message = new StandardLog(message.Severity, message.Source, message.Message, message.Exception); PrintLog(Message); return(Task.CompletedTask); }
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(); }
void Awake() { this.log = LogManager.GetCurrentClassLogger(this.name); }