예제 #1
0
 internal static void WriteLineIf(bool condition, string str, LogTag logTag)
 {
     if (condition)
     {
         WriteLine(str, logTag, LogTag.NewLine);
     }
 }
예제 #2
0
        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);
                }
            }
        }
예제 #3
0
        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);
                    }
                }
            }
        }
예제 #4
0
 internal static void WriteLine(string str, LogTag logTag)
 {
     WriteLine(str, logTag, LogTag.NewLine);
 }
예제 #5
0
 public static bool IsTrace(LogTag tag)
 {
     return(tag == LogTag.TraceSuccess || tag == LogTag.TraceProperty || tag == LogTag.TraceFailure || tag == LogTag.TraceException || tag == LogTag.LogMessage);
 }