コード例 #1
0
 public static ILogManager AddConsole(this ILogManager logManager, LogLevel minLevel)
 {
     if (logManager == null)
     {
         throw new ArgumentNullException(nameof(logManager));
     }
     logManager.Add(new ConsoleLoggerFactory(minLevel));
     return(logManager);
 }
コード例 #2
0
        public void Logging(LogDetail log)
        {
            if (log != null)
            {
                string _detail = JsonConvert.SerializeObject(log);

                Log _log = new Log()
                {
                    ID       = _logManager.CreateGuid(),
                    DateTime = DateTime.Now,
                    Detail   = _detail
                };

                _logManager.Add(_log);
                _logManager.Save();
            }
        }
コード例 #3
0
 /// <summary>
 /// Add message to service log.
 /// </summary>
 /// <param name="message">The log message.</param>
 public void AddLog(string message)
 {
     logManager.Add(serviceId, message);
 }