Data.CommonCmdletBase.WriteLog C# (CSharp) Method

WriteLog() protected method

protected WriteLog ( LogLevels logLevel, ErrorRecord errorRecord ) : void
logLevel LogLevels
errorRecord System.Management.Automation.ErrorRecord
return void
        protected void WriteLog(LogLevels logLevel, ErrorRecord errorRecord)
        {
            if (!Preferences.AutoLog) return;
            WriteLog(logLevel, errorRecord.Exception.Message);
            // 20131102
            //this.WriteLog(logLevel, "Script: '" + errorRecord.InvocationInfo.ScriptName + "', line: " + errorRecord.InvocationInfo.Line.ToString());
            WriteLog(logLevel, "Script: '" + errorRecord.InvocationInfo.ScriptName + "', line: " + errorRecord.InvocationInfo.Line);
            /*
            if (Preferences.AutoLog)
            {

                this.WriteLog(logLevel, errorRecord.Exception.Message);
                // 20131102
                //this.WriteLog(logLevel, "Script: '" + errorRecord.InvocationInfo.ScriptName + "', line: " + errorRecord.InvocationInfo.Line.ToString());
                this.WriteLog(logLevel, "Script: '" + errorRecord.InvocationInfo.ScriptName + "', line: " + errorRecord.InvocationInfo.Line);
            }
            */
        }
        

Same methods

CommonCmdletBase::WriteLog ( LogLevels logLevel, string logRecord ) : void