Example #1
0
        protected override void OnLog(LogEventArgs itm)
        {
            var createdAt = DateTimeFormatter.WriteToString(itm.CreatedAtUtc);
            var level     = LogLevelFormatter.WriteToString(itm.Level);

            Console.WriteLine($"{createdAt} {level}: {itm.Message}");
        }
Example #2
0
 protected override void OnLog(LogEventArgs itm)
 {
     lock (SyncLock)
     {
         var createdAt = DateTimeFormatter.WriteToString(itm.CreatedAtUtc);
         var level     = LogLevelFormatter.WriteToString(itm.Level);
         _outputStream.WriteLine($"{createdAt} {level} {itm.Message}");
     }
 }
        protected override void OnLog(LogEventArgs itm)
        {
            var createdAt = DateTimeFormatter.WriteToString(itm.CreatedAtUtc);
            var level     = LogLevelFormatter.WriteToString(itm.Level);

            Console.ForegroundColor = ConsoleColor.DarkGray;
            Console.Write(createdAt);
            Console.Write(' ');
            var levelColor = GetLevelColor(itm.Level);

            Console.ForegroundColor = levelColor;
            Console.Write(level);
            Console.Write(": ");
            Console.ResetColor();
            Console.WriteLine(itm.Message);
        }
 public void Render(LogEvent @event, TextWriter writer) =>
 writer.Write(LogLevelFormatter.Format(@event.Level));