示例#1
0
文件: Logger.cs 项目: RiasKlein/SMAPI
        /// <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();
                }
            }
        }
示例#2
0
文件: Logger.cs 项目: RiasKlein/SMAPI
        /// <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();
                }
            }
        }
示例#3
0
文件: Logger.cs 项目: RiasKlein/SMAPI
 private static void PrintLog(LogInfo li)
 {
     _writer.WriteToLog(li);
 }