Homepage Demos Overview Downloads Tutorials Reference
Credits
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Search

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 
00015   //!opens a custom (embedded) menu to toggle individual EGIDs
00016   virtual ControlBase* doSelect();
00017   
00018   virtual void refresh();
00019 
00020   //!sends all events received to stdout and/or logfile
00021   virtual void processEvent(const EventBase& event);
00022 
00023 protected:
00024   //!sets the status char of slot @a i to @a c
00025   void setStatus(unsigned int i, char c);
00026 
00027   //!checks to see if logfilePath differs from the StringInputControl's value and switches it if it is
00028   void checkLogFile();
00029   
00030   //!address of the logfile, if any (empty string is no logfile)
00031   std::string logfilePath;
00032 
00033   //!if a filename is given, events are logged to here
00034   std::ofstream logfile;
00035 
00036   //!controls the level of verbosity - currently 0 through 2
00037   unsigned int verbosity;
00038 };
00039 
00040 /*! @file
00041  * @brief Describes EventLogger, which allows logging of events to the console or a file
00042  * @author ejt (Creator)
00043  *
00044  * $Author: ejt $
00045  * $Name: tekkotsu-1_4_1 $
00046  * $Revision: 1.4 $
00047  * $State: Exp $
00048  * $Date: 2003/06/09 08:05:12 $
00049  */
00050 
00051 #endif

Tekkotsu v1.4
Generated Sat Jul 19 00:06:30 2003 by Doxygen 1.3.2