EventLog is a simple text-based event logger. More...
#include <Component/EventLog.H>
Classes | |
struct | LogEvent |
Public Member Functions | |
EventLog (OptionManager &mgr, const std::string &descrName="Event Log", const std::string &tagName="EventLog") | |
Constructor. | |
virtual | ~EventLog () |
Destructor. | |
void | pushEvent (const std::string &msg) |
push a new event into the event queue | |
void | pushEventBegin (const std::string &msg) |
push the beginning of an event into our queue | |
void | pushEventEnd (const std::string &msg) |
push the end of an event into our queue | |
Protected Member Functions | |
virtual void | start1 () |
get started | |
virtual void | stop2 () |
get stopped | |
Protected Attributes | |
OModelParam< std::string > | itsFileName |
filename for event log output |
EventLog is a simple text-based event logger.
EventLog allows simple logging of various user-defined events, with simultaneous recording of the (real) time at which the events were triggered. This functionality used to be part of PsychoDisplay. EventLog derives from ModelComponent and hence can be configured via the command line. EventLog complements at least two types of logging available in this toolkit: in Util/log.H, functions are defined which can generate logs onto stderr or syslog, prepending class and function name to any event. In addition, ModelComponent itself has a built-int logging facility that logs events to file without a timestamp (see --txtlog command-line option). One critical feature of EventLog is its ability to keep all logs in a mmory queue util the program is stopped, hence avoiding disk access during execution of a program.
Definition at line 61 of file EventLog.H.
EventLog::EventLog | ( | OptionManager & | mgr, | |
const std::string & | descrName = "Event Log" , |
|||
const std::string & | tagName = "EventLog" | |||
) |
Constructor.
Definition at line 48 of file EventLog.C.
EventLog::~EventLog | ( | ) | [virtual] |
Destructor.
Definition at line 58 of file EventLog.C.
void EventLog::pushEvent | ( | const std::string & | msg | ) |
push a new event into the event queue
Definition at line 115 of file EventLog.C.
References Timer::get().
Referenced by pushEventBegin(), and pushEventEnd().
void EventLog::pushEventBegin | ( | const std::string & | msg | ) |
push the beginning of an event into our queue
This is like pushEvent() but it will add a start marker to the string
Definition at line 125 of file EventLog.C.
References pushEvent().
void EventLog::pushEventEnd | ( | const std::string & | msg | ) |
push the end of an event into our queue
This is like pushEvent() but it will add an end marker to the string
Definition at line 129 of file EventLog.C.
References pushEvent().
void EventLog::start1 | ( | ) | [protected, virtual] |
get started
Reimplemented from ModelComponent.
Definition at line 64 of file EventLog.C.
References Timer::reset().
void EventLog::stop2 | ( | ) | [protected, virtual] |
get stopped
Reimplemented from ModelComponent.
Definition at line 78 of file EventLog.C.
References OModelParam< T >::getVal(), itsFileName, sec(), and sformat().
OModelParam<std::string> EventLog::itsFileName [protected] |