Ejemplo n.º 1
0
        /// <summary>
        /// 记录日志条目。
        /// </summary>
        /// <param name="logger">日志记录器。</param>
        /// <param name="log">日志对象。</param>
        /// <param name="ex">引起程序错误的异常。</param>
        /// <param name="extensions">日志扩展信息(匿名对象)。</param>
        internal static void Write(this ILogger logger, LogEntry log, Exception ex = null, object extensions = null)
        {
            var dir = extensions.ToDictionary();

            log.AddRange(dir, false);
            logger.Log(log.LogLevel, log.EventId, log, ex, LogFormatter);
        }