internal static void WriteLineIf(bool condition, string str, LogTag logTag) { if (condition) { WriteLine(str, logTag, LogTag.NewLine); } }
internal static void WriteLine(string str, LogTag logTag, string newLineReplacement) { if (str != null) { str = str.Replace("\\r\\n", Environment.NewLine); if (ToolConsole.Verbosity > Verbosity.Minimal || logTag == LogTag.Error || logTag == LogTag.Important || (ToolConsole.Verbosity == Verbosity.Minimal && logTag == LogTag.Warning) || LogTag.IsTrace(logTag)) { if (IsMarkupEnabled) { str = logTag + str.Replace(Environment.NewLine, newLineReplacement); } Console.WriteLine(str); } } }
private void LogMessage(string message, LogTag logTag, bool logToUI = false) { if (this.EnableTracing || logToUI) { message = message?.Trim(); if (!string.IsNullOrEmpty(message)) { if (logTag == LogTag.Error) { ToolConsole.WriteError(message, isTrace: !logToUI); } else if (logTag == LogTag.Warning) { ToolConsole.WriteWarning(message, isTrace: !logToUI); } else { ToolConsole.WriteLine(message, logToUI ? LogTag.Information : LogTag.LogMessage); } } } }
internal static void WriteLine(string str, LogTag logTag) { WriteLine(str, logTag, LogTag.NewLine); }
public static bool IsTrace(LogTag tag) { return(tag == LogTag.TraceSuccess || tag == LogTag.TraceProperty || tag == LogTag.TraceFailure || tag == LogTag.TraceException || tag == LogTag.LogMessage); }