Esempio n. 1
0
 public static void WarningFormat(this TraceServiceBase traceService, int id, object message, object[] parameters)
 {
     if (traceService != null && traceService.IsWarningEnabled)
     {
         WarningFormat(traceService, id, message, parameters, null);
     }
 }
Esempio n. 2
0
 public static void InformationFormat(this TraceServiceBase traceService, int id, object message, object[] parameters)
 {
     if (traceService != null && traceService.IsInformationEnabled)
     {
         InformationFormat(traceService, id, message, parameters, null);
     }
 }
Esempio n. 3
0
 public static void InformationFormat(this TraceServiceBase traceService, int id, object message, object[] parameters, Exception exception)
 {
     if (message is string)
     {
         traceService.Information(id, string.Format(message as string, parameters), exception);
     }
     else
     {
         traceService.Information(id, message, exception);
     }
 }
Esempio n. 4
0
 public static void ErrorFormat(this TraceServiceBase traceService, int id, object message, object[] parameters, Exception exception)
 {
     if (message is string && parameters != null && parameters.Length > 0)
     {
         traceService.Error(id, string.Format(message as string, parameters), exception);
     }
     else
     {
         traceService.Error(id, message, exception);
     }
 }
Esempio n. 5
0
 public static void ErrorFormat(this TraceServiceBase traceService, int id, object message, object[] parameters)
 {
     if (parameters == null)
     {
         ErrorFormat(traceService, id, message, new object[] { }, null);
     }
     else
     {
         ErrorFormat(traceService, id, message, parameters, null);
     }
 }
Esempio n. 6
0
 public static void VerboseFormat(this TraceServiceBase traceService, int id, object message, object parameter)
 {
     if (parameter == null)
     {
         VerboseFormat(traceService, id, message, new object[] { });
     }
     else
     {
         VerboseFormat(traceService, id, message, new object[] { parameter });
     }
 }
Esempio n. 7
0
 public static void ErrorFormat(this TraceServiceBase traceService, int id, object message, object parameter)
 {
     if (traceService != null && traceService.IsErrorEnabled)
     {
         if (parameter == null)
         {
             ErrorFormat(traceService, id, message, new object[] { });
         }
         else
         {
             ErrorFormat(traceService, id, message, new object[] { parameter });
         }
     }
 }
Esempio n. 8
0
 public static void VerboseFormat(this TraceServiceBase traceService, int id, object message, object[] parameters, Exception exception)
 {
     if (traceService != null && traceService.IsVerboseEnabled)
     {
         if (message is string && parameters != null && parameters.Length > 0)
         {
             traceService.Verbose(id, string.Format(message as string, parameters), exception);
         }
         else
         {
             traceService.Verbose(id, message, exception);
         }
     }
 }
Esempio n. 9
0
 public static void VerboseFormat(this TraceServiceBase traceService, int id, object message, object[] parameters)
 {
     if (traceService != null && traceService.IsVerboseEnabled)
     {
         if (parameters == null)
         {
             VerboseFormat(traceService, id, message, new object[] { }, null);
         }
         else
         {
             VerboseFormat(traceService, id, message, parameters, null);
         }
     }
 }
Esempio n. 10
0
 public static void WarningFormat(this TraceServiceBase traceService, int id, object message, object[] parameters, Exception exception)
 {
     if (traceService != null && traceService.IsWarningEnabled)
     {
         if (message is string)
         {
             traceService.Warning(id, string.Format(message as string, parameters), exception);
         }
         else
         {
             traceService.Warning(id, message, exception);
         }
     }
 }
Esempio n. 11
0
        public TraceActivityScope(TraceServiceBase traceService, int eventId, string startMessage, string endMessage)
        {
            TraceService = traceService;

            var activityId = Guid.NewGuid();

            EventId = eventId;

            EndMessage    = endMessage;
            OldActivityId = TraceService.CurrentActivityId;

            TraceService.TraceActivityTransfer(eventId, startMessage, activityId);
            TraceService.CurrentActivityId = activityId;
            TraceService.TraceActivityStart(eventId, startMessage);
        }
Esempio n. 12
0
 public TraceActivityScope(TraceServiceBase traceService, int eventId, string message) :
     this(traceService, eventId,
          string.Format("Starting: [{0}]", message),
          string.Format("Ending: [{0}]", message))
 {
 }
Esempio n. 13
0
 public TraceMethodActivityScope(TraceServiceBase traceService, int eventId)
     : base(traceService, eventId, new StackFrame(1).GetMethod().Name)
 {
 }
Esempio n. 14
0
        public TraceActivityScope(TraceServiceBase traceService, int eventId, string message) :
            this(traceService, eventId,
             string.Format("Starting: [{0}]", message),
             string.Format("Ending: [{0}]", message))
        {

        }
Esempio n. 15
0
        public TraceActivityScope(TraceServiceBase traceService, int eventId, string startMessage, string endMessage)
        {
            TraceService = traceService;

            var activityId = Guid.NewGuid();
            EventId = eventId;

            EndMessage = endMessage;
            OldActivityId = TraceService.CurrentActivityId;

            TraceService.TraceActivityTransfer(eventId, startMessage, activityId);
            TraceService.CurrentActivityId = activityId;
            TraceService.TraceActivityStart(eventId, startMessage);
        }
Esempio n. 16
0
 public static void WarningFormat(this TraceServiceBase traceService, int id, object message, object parameter)
 {
     WarningFormat(traceService, id, message, new object[] { parameter });
 }
Esempio n. 17
0
 public static void WarningFormat(this TraceServiceBase traceService, int id, object message, object[] parameters)
 {
     WarningFormat(traceService, id, message, parameters, null);
 }
Esempio n. 18
0
        public TraceMethodActivityScope(TraceServiceBase traceService, int eventId)
            : base(traceService, eventId, new StackFrame(1).GetMethod().Name)
        {

        }