00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __PEEKABOT_LOG_HH
00019 #define __PEEKABOT_LOG_HH
00020
00021
00022 #include <string>
00023 #include <fstream>
00024 #include <stdexcept>
00025
00026 #include "Subscriber.hh"
00027 #include "MessageFormatter.hh"
00028
00029
00030 namespace peekabot
00031 {
00032
00038 class Log : public Subscriber
00039 {
00043 std::ofstream m_ofs;
00044
00048 const MessageFormatter &m_formatter;
00049
00050 public:
00063 Log(const std::string &filename, const MessageFormatter &formatter)
00064 throw(std::runtime_error);
00065
00066 virtual ~Log() throw() {}
00067
00072 virtual void handle_message(const Message &message) throw();
00073 };
00074
00075 }
00076
00077
00078 #endif // __PEEKABOT_LOG_HH