public static int GetLoggerLevel(string loggerName)
        {
            TracingLevel level       = TracingConfiguration._currentLevel;
            int          levelLength = 0;

            return(level._levelValue);
        }
Esempio n. 2
0
        private void WriteLog(TracingLevel level, string message)
        {
            TracingEvent logEvent = new TracingEvent();

            logEvent.Message    = message;
            logEvent.LoggerName = _loggerName;
            logEvent.Level      = level;

            DoAppend(logEvent);
        }
Esempio n. 3
0
 public void InfoFmtSip(string from, string to, string callId, string cseq, string message, params object[] args)
 {
     try {
         if (TracingLevel.CanLogInfo(this))
         {
             WriteLog(TracingLevel.Info, string.Format(message, args), from, to, callId, cseq);
         }
     } catch (Exception ex) {
         Trace.Write(ex);
     }
 }
Esempio n. 4
0
 public void InfoFmtEx(Exception exception, string message, params object[] args)
 {
     try {
         if (TracingLevel.CanLogInfo(this))
         {
             WriteLog(TracingLevel.Info, string.Format(message, args), exception);
         }
     } catch (Exception ex) {
         Trace.Write(ex);
     }
 }
Esempio n. 5
0
 public void Info(string from, string to, string callId, string cseq, Exception exception, string message)
 {
     try {
         if (TracingLevel.CanLogInfo(this))
         {
             WriteLog(TracingLevel.Info, message, exception, from, to, callId, cseq);
         }
     } catch (Exception ex) {
         Trace.Write(ex);
     }
 }
Esempio n. 6
0
 public void Info(Exception exception, string message)
 {
     try {
         if (TracingLevel.CanLogInfo(this))
         {
             WriteLog(TracingLevel.Info, message, exception);
         }
     } catch (Exception ex) {
         Trace.Write(ex);
     }
 }
Esempio n. 7
0
 public void ErrorFmt(string message, params object[] args)
 {
     try {
         if (TracingLevel.CanLogError(this))
         {
             WriteLog(TracingLevel.Error, string.Format(message, args));
         }
     } catch (Exception ex) {
         Trace.Write(ex);
     }
 }
Esempio n. 8
0
 public void Error(Exception exception, string message)
 {
     try {
         if (TracingLevel.CanLogError(this))
         {
             WriteLog(TracingLevel.Error, message, exception);
         }
     } catch (Exception ex) {
         Trace.Write(ex);
     }
 }
Esempio n. 9
0
 public void Warn(Exception exception, string message)
 {
     try {
         if (TracingLevel.CanLogWarn(this))
         {
             WriteLog(TracingLevel.Warn, message, exception);
         }
     } catch (Exception ex) {
         Trace.Write(ex);
     }
 }
Esempio n. 10
0
 public void Warn(string from, string to, string callId, string cseq, string message)
 {
     try {
         if (TracingLevel.CanLogWarn(this))
         {
             WriteLog(TracingLevel.Warn, message, from, to, callId, cseq);
         }
     } catch (Exception ex) {
         Trace.Write(ex);
     }
 }
Esempio n. 11
0
        private void WriteLog(TracingLevel level, string message, string from, string to, string callId, string cseq)
        {
            TracingEvent logEvent = new TracingEvent();

            logEvent.Message    = message;
            logEvent.LoggerName = _loggerName;
            logEvent.Level      = level;
            logEvent.From       = from;
            logEvent.To         = to;
            logEvent.CallId     = callId;
            logEvent.Cseq       = cseq;

            DoAppend(logEvent);
        }
Esempio n. 12
0
        static TracingConfiguration()
        {
            try
            {
                _defaultConfig = (TracingConfigSection)ConfigurationManager.GetSection("LoadingSkyLog");
                if (_defaultConfig == null)
                {
                    _defaultConfig = Activator.CreateInstance <TracingConfigSection>();
                }
            }
            catch {
                _defaultConfig = Activator.CreateInstance <TracingConfigSection>();
            }

            _currentLevel = TracingLevel.GetLogLevel(_defaultConfig.Level);
        }
Esempio n. 13
0
 internal static bool CanLog(TracingLevel level)
 {
     return(level._levelValue >= TracingConfiguration._currentLevel._levelValue);
 }