Exemple #1
0
        /// <summary>
        ///     Writes into the ConcurrentQueue the Message specified
        /// </summary>
        /// <param name="message">The message to write to the log</param>
        public void WriteToLog(string message)
        {
            lock (_logQueue)
            {
                var logEntry = new LogInfo(message);
                _logQueue.Enqueue(logEntry);

                if (_logQueue.Any())
                {
                    FlushLog();
                }
            }
        }
Exemple #2
0
        /// <summary>
        ///     Writes into the ConcurrentQueue the Entry specified
        /// </summary>
        /// <param name="logEntry">The logEntry to write to the log</param>
        public void WriteToLog(LogInfo logEntry)
        {
            lock (_logQueue)
            {
                _logQueue.Enqueue(logEntry);

                if (_logQueue.Any())
                {
                    FlushLog();
                }
            }
        }
Exemple #3
0
 private static void PrintLog(LogInfo li)
 {
     _writer.WriteToLog(li);
 }