/// <summary> /// Write a log message. /// </summary> /// <param name="level">Log level. Will throw exception when using DetectLogLevel.Error</param> /// <param name="msg">Log message.</param> /// <param name="startNewLine">Start a new line before this message when to UI. True by default.</param> /// <param name="style">The style of the message</param> public void AddLog(DetectLogLevel level, string msg, bool startNewLine = true, LogStyle style = LogStyle.Default) { switch (level) { case DetectLogLevel.Information: ProcessStepStatus(style); DetectorUtil.WriteLog(msg, startNewLine, style); break; case DetectLogLevel.Warning: ProcessStepStatus(style); break; case DetectLogLevel.Error: AddLog(DetectLogLevel.Information, msg); // PTM will handle the exception and pop up a dialog box to user. throw new Exception(msg); default: break; } }
public void AddLineToLog(DetectLogLevel level) { AddLog(level, string.Empty); }