private void MainLoop()
        {
            while (!_exit)
            {
                if (!_lines.IsEmpty)
                {
                    LogLine currentLine;

                    if (!_lines.TryDequeue(out currentLine))
                    {
                        if (_quitWithFlush)
                        {
                            _exit = true;
                        }

                        continue;
                    }

                    if (!_exit || _quitWithFlush)
                    {
                        lock (_writer)
                        {
                            _writer.Write(currentLine);
                        }
                    }

                    if (_quitWithFlush && _lines.IsEmpty)
                    {
                        lock (_writer)
                        {
                            if (_writer != null)
                            {
                                _writer.CloseLogWriter();
                            }
                        }

                        _exit = true;
                    }
                }
            }
        }