src/System.Management.Automation/utils/tracing/PSEtwLogProvider.cs
/// <summary>
/// Provider interface function for logging settings event.
/// </summary>
/// <param name="logContext"></param>
/// <param name="variableName"></param>
/// <param name="value"></param>
/// <param name="previousValue"></param>
Provider interface function for logging settings event.
Provider interface function for logging settings event .
internal override void LogSettingsEvent(LogContext logContext, string variableName, string value, string previousValue)
        {
            if (IsEnabled(PSLevel.Informational, PSKeyword.Cmdlets | PSKeyword.UseAlwaysAnalytic))
            {
                StringBuilder payload = new StringBuilder();
                if (previousValue == null)
                {
                    payload.AppendLine(StringUtil.Format(EtwLoggingStrings.SettingChangeNoPrevious, variableName, value));
                }
                else
                {
                    payload.AppendLine(StringUtil.Format(EtwLoggingStrings.SettingChange, variableName, previousValue, value));
                }
                WriteEvent(PSEventId.Settings, PSChannel.Analytic, PSOpcode.Method, PSTask.ExecutePipeline, logContext, payload.ToString());
            }
        }
internal override void LogSettingsEvent ( LogContext logContext , string variableName , string value , string previousValue ) { if ( IsEnabled ( PSLevel . Informational , PSKeyword . Cmdlets | PSKeyword . UseAlwaysAnalytic ) ) { StringBuilder payload = new StringBuilder ( ) ; if ( previousValue == null ) { payload . AppendLine ( StringUtil . Format ( EtwLoggingStrings . SettingChangeNoPrevious , variableName , value ) ) ; } else { payload . AppendLine ( StringUtil . Format ( EtwLoggingStrings . SettingChange , variableName , previousValue , value ) ) ; } WriteEvent ( PSEventId . Settings , PSChannel . Analytic , PSOpcode . Method , PSTask . ExecutePipeline , logContext , payload . ToString ( ) ) ; } }
Provider interface function for logging settings event.
Provider interface function for logging settings event .
logContext
LogContext
None
variableName
string
None
value
string
None
previousValue
string
None