• Main Page
  • Related Pages
  • Classes
  • Files
  • File List

src/Log.hh

00001 /*
00002  * This file is part of peekabot.
00003  *
00004  * peekabot is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 3 of the License, or
00007  * (at your option) any later version.
00008  *
00009  * peekabot is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
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

Generated on Sun Jan 30 2011 for peekabot by  doxygen 1.7.1