/// <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));
        }
Esempio n. 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);
            }
        }
Esempio n. 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);
     }
 }
Esempio n. 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);
 }
Esempio n. 5
0
 internal static void Trace(object message) => handler.Trace(message);