Пример #1
0
        public Task WriteLine(MetaLogEntity item)
        {
            switch (item.Severity)
            {
            case MetaLogErrorSeverity.Critical:
            case MetaLogErrorSeverity.Error:
                Console.ForegroundColor = ConsoleColor.Red;
                break;

            case MetaLogErrorSeverity.Warning:
                Console.ForegroundColor = ConsoleColor.DarkYellow;
                break;

            case MetaLogErrorSeverity.Info:
                Console.ForegroundColor = ConsoleColor.DarkGray;
                break;

            case MetaLogErrorSeverity.Debug:
            case MetaLogErrorSeverity.Trace:
                Console.ForegroundColor = ConsoleColor.White;
                break;

            default:
                Console.ForegroundColor = ConsoleColor.White;
                break;
            }

            Console.WriteLine(item);
            return(Task.CompletedTask);
        }
Пример #2
0
        void Log(string message, MetaLogErrorSeverity severity, string stackTrace = null)
        {
            var item = new MetaLogEntity()
            {
                Source     = this.Name,
                Timestamp  = DateTime.Now,
                Message    = message,
                Severity   = severity,
                StackTrace = stackTrace
            };

            Queue.Enqueue(item);
        }
Пример #3
0
 public Task WriteLine(MetaLogEntity item)
 {
     Debug.WriteLine(item);
     return(Task.CompletedTask);
 }
Пример #4
0
 Task ConsoleLogger_WriteLine(MetaLogEntity arg0)
 {
     return(ConsoleLogger.WriteLine(arg0));
 }
Пример #5
0
 Task TraceLogger_WriteLine(MetaLogEntity arg0)
 {
     return(TraceLogger.WriteLine(arg0));
 }
Пример #6
0
 Task Split_Put(MetaLogEntity arg0)
 {
     return(Split.Put(arg0));
 }