예제 #1
0
 private void LogIfNonAsync <TResult>(DbCommand command, DbCommandInterceptionContext <TResult> interceptionContext)
 {
     if (!interceptionContext.IsAsync)
     {
         _log.Warn("Non-async command used: " + DbCommandUtils.OneLineText(command));
     }
 }
예제 #2
0
 private void LogIfError <TResult>(DbCommand command, DbCommandInterceptionContext <TResult> interceptionContext)
 {
     if (interceptionContext.Exception != null)
     {
         _log.Error("Command " + DbCommandUtils.OneLineText(command) + " failed with exception", interceptionContext.Exception);
         if (interceptionContext.OriginalException != null)
         {
             _log.Error("OriginalException", interceptionContext.OriginalException);
         }
     }
 }
예제 #3
0
 public override void LogCommand <TResult>(DbCommand command, DbCommandInterceptionContext <TResult> interceptionContext)
 {
     Write(string.Format("Context '{0}' is executing command '{1}'", Context.GetType().Name, DbCommandUtils.OneLineText(command)));
 }