Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00031 #ifndef __CLAW_LOG_STREAM_CONCISE_HPP__
00032 #define __CLAW_LOG_STREAM_CONCISE_HPP__
00033
00034 #include <list>
00035 #include <string>
00036 #include <claw/log_stream.hpp>
00037
00038 #ifndef CLAW_LOGGER_EXPORT
00039 # ifdef CLAW_LOGGER_NO_EXPORT
00040 # define CLAW_LOGGER_EXPORT
00041 # else
00042 # ifdef _WIN32
00043 # ifdef claw_logger_EXPORTS
00044 # define CLAW_LOGGER_EXPORT __declspec(dllexport)
00045 # else
00046 # define CLAW_LOGGER_EXPORT __declspec(dllimport)
00047 # endif // def claw_logger_EXPORTS
00048 # else // def _WIN32
00049 # define CLAW_LOGGER_EXPORT
00050 # endif // def _WIN32
00051 # endif // def CLAW_LOGGER_NO_EXPORT
00052 #endif // ndef CLAW_LOGGER_EXPORT
00053
00054 namespace claw
00055 {
00061 class CLAW_LOGGER_EXPORT log_stream_concise:
00062 public log_stream,
00063 public pattern::non_copyable
00064 {
00065 public:
00066 explicit log_stream_concise
00067 ( log_stream* s, std::size_t max_history_size = 25 );
00068 virtual ~log_stream_concise();
00069
00070 virtual void write( const std::string& str );
00071 virtual void flush();
00072
00073 private:
00074 void output_current_line();
00075
00076 private:
00078 log_stream* m_stream;
00079
00081 std::string m_current_line;
00082
00084 std::list<std::string> m_previous_lines;
00085
00087 std::size_t m_max_history_size;
00088
00089 };
00090 }
00091
00092 #endif // __CLAW_LOG_STREAM_CONCISE_HPP__