public void Write(LogMessageEntry entry)
        {
            if (!_messageQueue.IsAddingCompleted)
            {
                try
                {
                    _messageQueue.Add(entry);
                    return;
                }
                catch (InvalidOperationException)
                {
                }
            }

            _inner.Write(entry);
        }
Example #2
0
        public void Write(LogMessageEntry entry)
        {
            _lock.Wait();

            try
            {
                if (entry.LevelString != null)
                {
                    _console.Write(entry.LevelString, entry.LevelBackground, entry.LevelForeground);
                }
                _console.Write(entry.Message, entry.MessageColor, entry.MessageColor);
            }
            finally
            {
                _lock.Release();
            }

            _console.Flush();
        }