Homepage Demos Overview Downloads Tutorials Reference
Credits

EventLogger.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_EventLogger_h_
00003 #define INCLUDED_EventLogger_h_
00004 
00005 #include "ControlBase.h"
00006 #include "Events/EventListener.h"
00007 #include <fstream>
00008 
00009 //! allows logging of events to the console or a file
00010 class EventLogger : public ControlBase, public EventListener {
00011 public:
00012   //!constructor
00013   EventLogger();
00014   virtual ~EventLogger() { clearSlots(); }
00015 
00016   //!opens a custom (embedded) menu to toggle individual EGIDs
00017   virtual ControlBase* doSelect();
00018   
00019   virtual void refresh();
00020 
00021   //!sends all events received to stdout and/or logfile
00022   virtual void processEvent(const EventBase& event);
00023 
00024 protected:
00025   virtual void clearSlots();
00026 
00027   //!sets the status char of slot @a i to @a c
00028   void setStatus(unsigned int i, char c);
00029 
00030   //!checks to see if logfilePath differs from the StringInputControl's value and switches it if it is
00031   void checkLogFile();
00032   
00033   //!address of the logfile, if any (empty string is no logfile)
00034   std::string logfilePath;
00035 
00036   //!if a filename is given, events are logged to here
00037   std::ofstream logfile;
00038 
00039   //!controls the level of verbosity - currently 0 through 2
00040   unsigned int verbosity;
00041 };
00042 
00043 /*! @file
00044  * @brief Describes EventLogger, which allows logging of events to the console or a file
00045  * @author ejt (Creator)
00046  *
00047  * $Author: ejt $
00048  * $Name: tekkotsu-2_2 $
00049  * $Revision: 1.6 $
00050  * $State: Exp $
00051  * $Date: 2004/10/07 22:15:20 $
00052  */
00053 
00054 #endif

Tekkotsu v2.2
Generated Tue Oct 19 14:19:14 2004 by Doxygen 1.3.9.1