示例#1
0
        private static LogLevel Convert(Acb.Core.Logging.LogLevel level)
        {
            switch (level)
            {
            case Acb.Core.Logging.LogLevel.Trace:
                return(LogLevel.Trace);

            case Acb.Core.Logging.LogLevel.Debug:
                return(LogLevel.Debug);

            case Acb.Core.Logging.LogLevel.Info:
                return(LogLevel.Information);

            case Acb.Core.Logging.LogLevel.Warn:
                return(LogLevel.Warning);

            case Acb.Core.Logging.LogLevel.Error:
                return(LogLevel.Error);

            case Acb.Core.Logging.LogLevel.Fatal:
                return(LogLevel.Critical);
            }

            return(LogLevel.None);
        }
示例#2
0
        protected override void WriteInternal(Acb.Core.Logging.LogLevel level, object message, Exception exception)
        {
            var msg = message.GetType().IsSimpleType() ? message.ToString() : JsonConvert.SerializeObject(message);

            _logger.Log(Convert(level), new EventId(0), exception, msg);
        }