Пример #1
0
 public void Dispose()
 {
     _watch.Stop();
     if (this._logSuccess || !this.Success)
     {
         DashTrace.TraceInformation(new TraceMessage
         {
             Operation = "Completed",
             Success   = this.Success,
             Duration  = _watch.ElapsedMilliseconds,
             Message   = this._operation,
         });
     }
 }
Пример #2
0
 protected OperationRunner(string operation, bool?logSuccess = null)
 {
     _operation = operation;
     if (logSuccess.HasValue)
     {
         _logSuccess = logSuccess.Value;
     }
     else
     {
         _logSuccess = DashConfiguration.LogNormalOperations;
     }
     if (_logSuccess)
     {
         DashTrace.TraceInformation(new TraceMessage
         {
             Operation = "Start",
             Message   = operation,
         });
     }
     this.Success = true;
     _watch       = Stopwatch.StartNew();
 }