예제 #1
0
        protected override void BaseAction(Action <TextWriter> action)
        {
            var sb = new StringBuilder();

            using (var stringWriter = new StringWriter(sb))
            {
                TimeStamp(stringWriter);
                action(stringWriter);
            }

            BaseTextWriter.Write(sb);
        }
예제 #2
0
        private void ProcessCurrentLine()
        {
            // update maximum line length if necessary
            if (MaximumLineLength < _currentLine.Length)
            {
                MaximumLineLength = _currentLine.Length;
            }

            // complete line found -> check if it should be passed to base text writer or not
            if (_lineFilter(_currentLine))
            {
                BaseTextWriter.Write(_currentLine.ToString());
            }
            // reset current line
            _currentLine.Length = 0;
        }