示例#1
0
        public static void WriteTo(string name, string info, Exception ex = null)
        {
            if (string.IsNullOrEmpty(name))
            {
                name = "Complement";
            }
            var    lazy      = new Lazy <Logger>(() => LogManager.GetLogger(name));
            Logger customLog = _customLoggers.GetOrAdd(name, lazy.Value);

            if (customLog != null)
            {
                customLog.Log(LogLevel.Trace, LogHelper.BuildMessage(info, ex));
            }
        }
示例#2
0
 private static string BuildMessage(string info)
 {
     return(LogHelper.BuildMessage(info, null));
 }