41 std::size_t max_history_size)
43 , m_max_history_size(max_history_size)
60 std::string::size_type p = str.find_first_of(
'\n');
62 if(p == std::string::npos)
63 m_current_line += str;
67 m_current_line += str.substr(0, p);
69 output_current_line();
87void claw::log_stream_concise::output_current_line()
89 if(std::find(m_previous_lines.begin(), m_previous_lines.end(),
91 == m_previous_lines.end())
93 m_previous_lines.push_back(m_current_line);
94 m_stream->write(m_current_line);
96 if(m_previous_lines.size() > m_max_history_size)
97 m_previous_lines.pop_front();
100 m_current_line.clear();
log_stream_concise(log_stream *s, std::size_t max_history_size=25)
Constructor.
virtual ~log_stream_concise()
Destructor.
virtual void write(const std::string &str)
Write a string in the stream.
virtual void flush()
Flush the stream.
Base class for streams accepting log output.
A log stream that does not output a message that have been recently output.