Exemple #1
0
 internal static void LogCommandLifecycleEvent(
     ExecutionContext executionContext,
     CommandState commandState,
     InvocationInfo invocationInfo)
 {
     using (MshLog._trace.TraceMethod())
     {
         if (executionContext == null)
         {
             MshLog._trace.NewArgumentNullException(nameof(executionContext));
         }
         else if (invocationInfo == null)
         {
             MshLog._trace.NewArgumentNullException(nameof(invocationInfo));
         }
         else
         {
             if (!MshLog.NeedToLogCommandLifecycleEvent(executionContext))
             {
                 return;
             }
             MshLog.GetLogProvider(executionContext).LogCommandLifecycleEvent(MshLog.GetLogContext(executionContext, invocationInfo), commandState);
         }
     }
 }
Exemple #2
0
 internal static void LogCommandLifecycleEvent(
     ExecutionContext executionContext,
     CommandState commandState,
     string commandName)
 {
     using (MshLog._trace.TraceMethod())
     {
         if (executionContext == null)
         {
             MshLog._trace.NewArgumentNullException(nameof(executionContext));
         }
         else
         {
             if (!MshLog.NeedToLogCommandLifecycleEvent(executionContext))
             {
                 return;
             }
             LogContext logContext = MshLog.GetLogContext(executionContext, (InvocationInfo)null);
             logContext.CommandName = commandName;
             MshLog.GetLogProvider(executionContext).LogCommandLifecycleEvent(logContext, commandState);
         }
     }
 }