/// <summary> /// NeedToLogProviderHealthEvent: check whether logging Provider health event is necessary. /// Whether to log Provider health event is controled by session variable "LogProviderHealthEvent" /// The default value for this is true. /// </summary> /// <param name="logProvider"></param> /// <param name="executionContext"></param> /// <returns></returns> private static bool NeedToLogProviderHealthEvent(LogProvider logProvider, ExecutionContext executionContext) { if (!logProvider.UseLoggingVariables()) { return true; } return LanguagePrimitives.IsTrue(executionContext.GetVariableValue(SpecialVariables.LogProviderHealthEventVarPath, true)); }
private static bool NeedToLogSettingsEvent(LogProvider logProvider, System.Management.Automation.ExecutionContext executionContext) { return (!logProvider.UseLoggingVariables() || LanguagePrimitives.IsTrue(executionContext.GetVariableValue(SpecialVariables.LogSettingsEventVarPath, true))); }
/// <summary> /// NeedToLogPipelineExecutionDetailEvent: check whether logging pipeline execution detail event is necessary. /// /// Whether to log command lifecycle event is controled by PSSnapin set up. /// /// Should we use session variable "LogPipelineExecutionEvent" to control this also? /// /// Currently we return true always since pipeline processor already check for whether to log /// logic from PSSnapin already. This may need to be changed. /// </summary> /// <param name="logProvider"></param> /// <param name="executionContext"></param> /// <returns></returns> private static bool NeedToLogPipelineExecutionDetailEvent(LogProvider logProvider, ExecutionContext executionContext) { if (!logProvider.UseLoggingVariables()) { return true; } return true; // return LanguagePrimitives.IsTrue(executionContext.GetVariable("LogPipelineExecutionDetailEvent", false)); }
private static bool NeedToLogPipelineExecutionDetailEvent(LogProvider logProvider, System.Management.Automation.ExecutionContext executionContext) { return (!logProvider.UseLoggingVariables() || true); }