コード例 #1
0
        public static int GetLoggerLevel(string loggerName)
        {
            TracingLevel level       = TracingConfiguration._currentLevel;
            int          levelLength = 0;

            return(level._levelValue);
        }
コード例 #2
0
ファイル: TracingImpl.cs プロジェクト: thachgiasoft/Tempsen
        private void WriteLog(TracingLevel level, string message)
        {
            TracingEvent logEvent = new TracingEvent();

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

            DoAppend(logEvent);
        }
コード例 #3
0
ファイル: TracingImpl.cs プロジェクト: thachgiasoft/Tempsen
 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);
     }
 }
コード例 #4
0
ファイル: TracingImpl.cs プロジェクト: thachgiasoft/Tempsen
 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);
     }
 }
コード例 #5
0
ファイル: TracingImpl.cs プロジェクト: thachgiasoft/Tempsen
 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);
     }
 }
コード例 #6
0
ファイル: TracingImpl.cs プロジェクト: thachgiasoft/Tempsen
 public void Info(Exception exception, string message)
 {
     try {
         if (TracingLevel.CanLogInfo(this))
         {
             WriteLog(TracingLevel.Info, message, exception);
         }
     } catch (Exception ex) {
         Trace.Write(ex);
     }
 }
コード例 #7
0
ファイル: TracingImpl.cs プロジェクト: thachgiasoft/Tempsen
 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);
     }
 }
コード例 #8
0
ファイル: TracingImpl.cs プロジェクト: thachgiasoft/Tempsen
 public void Error(Exception exception, string message)
 {
     try {
         if (TracingLevel.CanLogError(this))
         {
             WriteLog(TracingLevel.Error, message, exception);
         }
     } catch (Exception ex) {
         Trace.Write(ex);
     }
 }
コード例 #9
0
ファイル: TracingImpl.cs プロジェクト: thachgiasoft/Tempsen
 public void Warn(Exception exception, string message)
 {
     try {
         if (TracingLevel.CanLogWarn(this))
         {
             WriteLog(TracingLevel.Warn, message, exception);
         }
     } catch (Exception ex) {
         Trace.Write(ex);
     }
 }
コード例 #10
0
ファイル: TracingImpl.cs プロジェクト: thachgiasoft/Tempsen
 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);
     }
 }
コード例 #11
0
ファイル: TracingImpl.cs プロジェクト: thachgiasoft/Tempsen
        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);
        }
コード例 #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);
        }
コード例 #13
0
ファイル: TracingLevel.cs プロジェクト: thachgiasoft/Tempsen
 internal static bool CanLog(TracingLevel level)
 {
     return(level._levelValue >= TracingConfiguration._currentLevel._levelValue);
 }