/// <summary>
        /// Write debug message to log
        /// </summary>
        /// <param name="logHandler"></param>
        /// <param name="text">Message</param>
        /// <param name="args">Arguments to format.</param>
        public static void Trace(this ILogHandler logHandler, string text, params object[] args)
        {
            if (logHandler == null)
            {
                throw new ArgumentNullException("logHandler", "Log Handler cannot be null");
            }

            logHandler.Trace(string.Format(text, args));
        }
Beispiel #2
0
        public override void Write(char ch)
        {
            base.Write(ch);

            if (ch.Equals('\n'))
            {
                _logger.Trace(_sb.ToString());
                _sb.Clear();
            }
            else if (!ch.Equals('\r'))
            {
                _sb.Append(ch);
            }
        }
Beispiel #3
0
 /// <summary>
 /// Log trace
 /// </summary>
 public static void Trace(string traceText, bool overrideMessageFloodProtection = false)
 {
     try
     {
         if (traceText == _lastTraceText && !overrideMessageFloodProtection)
         {
             return;
         }
         _logHandler.Trace(traceText);
         _lastTraceText = traceText;
     }
     catch (Exception err)
     {
         Console.WriteLine("Log.Trace(): Error writing trace: " + err.Message);
     }
 }
Beispiel #4
0
 /// <summary>
 /// Write trace message to log
 /// </summary>
 /// <param name="text">The trace text to log</param>
 public void Trace(string text)
 {
     WriteMessage(LogType.Trace, text);
     _fileLogger.Trace(text);
 }
Beispiel #5
0
 internal static void Trace(object message) => handler.Trace(message);