#include <CAlarmLogger.h>
Public Methods | |
CAlarmLogger (string facility, string host="localhost", string port="daqalarm") | |
The port to log to. More... | |
CAlarmLogger (const CAlarmLogger &aCAlarmLogger) | |
~CAlarmLogger () | |
string | getFacility () |
string | getHost () |
string | getPort () |
void | Log (string message) |
Protected Methods | |
void | setFacility (string fac) |
void | setHost (const string &host) |
void | setPort (const string &port) |
Definition at line 41 of file CAlarmLogger.h.
|
The port to log to. "Default Constructor" This is the default constructor which constructs a CAlarmLogger given a list of hosts to which it will form socket connections when logging events, and a facility name which will be the name of the facility doing the logging.
Definition at line 27 of file CAlarmLogger.cpp. |
|
"Copy Constructor" This is the copy constructor. It creates a new object by copying the information of the reference object which is its parameter.
Definition at line 53 of file CAlarmLogger.cpp. |
|
"Destructor" Called when an object goes out of scope, or when execution of the program is terminated. Destroys the object, and frees up space. Definition at line 63 of file CAlarmLogger.cpp. |
|
Operation Type: Log to file and screen Attempts to log a message (facility, severity, message, date) to EventLog.tcl by opening a socket connection to each of the hosts in m_HostList. The first connection logs the message which consists of the facility, severity, and message to the log file via a call to the tcl procedure Logger::Log. This only needs to be written once, since the same log file will be used by each displayer. The Logger::Log tcl procedure obtains the exact time of the event via a call to date(1). It then returns the date string through the socket (which we read) and that string is what is displayed on the GUI via a call to Logger::Display_Event. In this way, the date on each display will be exactly the same. NOTE: If Log() fails for the first host in the list, then the event will not be written to the log file and will not be displayed anywhere. If connection to the first host succeeds, but fails on a subsequent host, the event will be logged to file but will not be displayed on whichever host connection failed. It will, however, be displayed on all hosts (including subsequent hosts) to which connection does not fail.
Definition at line 99 of file CAlarmLogger.cpp. |