#include <feeserver/fee_msg.hh>

Public Types | |
| typedef Message::Event | Event |
Public Member Functions | |
| MessageChannel (const std::string &server, const std::string &detector, unsigned long mask=(Message::Info|Message::Warning|Message::Error|Message::AuditFailure|Message::AuditSuccess|Message::Debug|Message::Alarm)) | |
| virtual | ~MessageChannel () |
| void | Clear () |
| void | Send (Event event, const std::string &where, const char *format,...) |
| void | HandleRepeats () |
| void | SetLogMask (unsigned int mask) |
| unsigned int | LogMask () const |
| bool | CheckEvent (Event event) const |
Protected Member Functions | |
| MessageChannel (const MessageChannel &) | |
| MessageChannel & | operator= (const MessageChannel &) |
| void | UnlockedSend (Event event, const std::string &where, const char *format,...) |
| void | DoSend (Event event, const std::string &where, const std::string &msg) |
Protected Attributes | |
| Message | _msg |
| DimService * | _service |
| Mutex | _mutex |
| std::string | _last |
| const std::string | _server |
| unsigned int | _repeats |
| unsigned int | _log_mask |
| std::vector< unsigned char > | _buf |
Friends | |
| class | MessageWatchdog |
| FeeServer::MessageChannel::MessageChannel | ( | const std::string & | server, | |
| const std::string & | detector, | |||
| unsigned long | mask = (Message::Info | Message::Warning | Message::Error | Message::AuditFailure | Message::AuditSuccess | Message::Debug | Message::Alarm) | |||
| ) |
Constructor
| server | Server name | |
| detector | Detector name | |
| mask | The log mask |
| FeeServer::MessageChannel::~MessageChannel | ( | ) | [virtual] |
Destructor
| FeeServer::MessageChannel::MessageChannel | ( | const MessageChannel & | ) | [protected] |
Not implemented
| void FeeServer::MessageChannel::Clear | ( | ) |
Clear the message structure.
| void FeeServer::MessageChannel::Send | ( | Event | event, | |
| const std::string & | where, | |||
| const char * | format, | |||
| ... | ||||
| ) |
Send a message
| event | The event type | |
| where | Where the event happened. | |
| format | printf-like format |
| void FeeServer::MessageChannel::HandleRepeats | ( | ) |
Handle repeated messages
| void FeeServer::MessageChannel::SetLogMask | ( | unsigned int | mask | ) | [inline] |
Set the log-level
| unsigned int FeeServer::MessageChannel::LogMask | ( | ) | const [inline] |
Get the log mask
| bool FeeServer::MessageChannel::CheckEvent | ( | Event | event | ) | const [inline] |
Check that we want log messages for a type of events
| MessageChannel& FeeServer::MessageChannel::operator= | ( | const MessageChannel & | ) | [protected] |
Not implemented
| void FeeServer::MessageChannel::UnlockedSend | ( | Event | event, | |
| const std::string & | where, | |||
| const char * | format, | |||
| ... | ||||
| ) | [protected] |
As Send, except it doesn't lock the mutex
| void FeeServer::MessageChannel::DoSend | ( | Event | event, | |
| const std::string & | where, | |||
| const std::string & | msg | |||
| ) | [protected] |
Core of the send methods
std::cout << _msg << std::endl;
friend class MessageWatchdog [friend] |
Watch dog is a friend
Message FeeServer::MessageChannel::_msg [protected] |
Messagge
DimService* FeeServer::MessageChannel::_service [protected] |
The service
Mutex FeeServer::MessageChannel::_mutex [protected] |
std::string FeeServer::MessageChannel::_last [protected] |
Last description
const std::string FeeServer::MessageChannel::_server [protected] |
Server name
unsigned int FeeServer::MessageChannel::_repeats [protected] |
Number of repeats
unsigned int FeeServer::MessageChannel::_log_mask [protected] |
Stores the current log level for this FeeServer. In case the environmental variable FEE_LOG_LEVEL is set, this value will be used.
std::vector<unsigned char> FeeServer::MessageChannel::_buf [protected] |
Buffer
1.5.6