![]() |
The Gaudi Framework
v31r0 (aeb156f0)
|
#include <GaudiKernel/Message.h>

Public Member Functions | |
| Message ()=default | |
| Default constructor. More... | |
| Message (const char *src, int type, const char *msg) | |
| Constructor. More... | |
| Message (std::string src, int type, std::string msg) | |
| Constructor. More... | |
| ~Message ()=default | |
| Default destructor. More... | |
| const std::string & | getMessage () const |
| Get the message string. More... | |
| void | setMessage (std::string msg) |
| Set the message string. More... | |
| int | getType () const |
| Get the message type. More... | |
| void | setType (int msg_type) |
| Set the message type. More... | |
| const std::string & | getSource () const |
| Get the message source. More... | |
| void | setSource (std::string src) |
| Set the message source. More... | |
| const std::string & | getFormat () const |
| Get the format string. More... | |
| void | setFormat (std::string msg) const |
| Set the format string. More... | |
| const std::string & | getTimeFormat () const |
| Get the time format string. More... | |
| void | setTimeFormat (std::string timeFormat) const |
| Set the time format string. More... | |
| bool | operator< (const Message &test) |
| Needed to build maps. More... | |
Static Public Member Functions | |
| static const std::string | getDefaultFormat () |
| Get the default format string. More... | |
| static const std::string | getDefaultTimeFormat () |
| Get the default time format string. More... | |
Private Member Functions | |
| void | invalidFormat () const |
| Called when an invalid format string is encountered. More... | |
| void | makeFormattedMsg (const std::string &format) const |
| Format the message. More... | |
| void | decodeFormat (const std::string &format) const |
| Decode format. More... | |
| void | sizeField (const std::string &text) const |
| Truncate or pad the output string to the field width as necessary. More... | |
| void | setWidth (const std::string &formatArg) const |
| Set the width of a stream. More... | |
Private Attributes | |
| std::string | m_message |
| The message text. More... | |
| std::string | m_source {"UNKNOWN"} |
| The message source. More... | |
| int | m_type {0} |
| The message type/level. More... | |
| std::string | m_format {DEFAULT_FORMAT} |
| The format string. More... | |
| std::string | m_time_format {DEFAULT_TIME_FORMAT} |
| Time format string. More... | |
| std::string | m_formatted_msg |
| Formatted message. More... | |
| char | m_fill {' '} |
| Current fill character. More... | |
| int | m_width {0} |
| Current field width. More... | |
| bool | m_left {true} |
| The message alignment. More... | |
Event identifiers | |
| EventContext::ContextID_t | m_ecSlot {Gaudi::Hive::currentContext().slot()} |
| Event slot. More... | |
| EventContext::ContextEvt_t | m_ecEvt {Gaudi::Hive::currentContext().evt()} |
| Event number. More... | |
| EventIDBase | m_ecEvtId {Gaudi::Hive::currentContext().eventID()} |
| Full event ID. More... | |
| pthread_t | m_ecThrd {pthread_self()} |
| Thread ID. More... | |
Static Private Attributes | |
| static constexpr const char * | DEFAULT_FORMAT = "% F%18W%S%7W%R%T %0W%M" |
| The default message format. More... | |
| static constexpr const char * | DEFAULT_TIME_FORMAT = "%Y-%m-%d %H:%M:%S,%f" |
| The default time format (accepts strftime formatters plus %f for milliseconds). More... | |
Formatting characters | |
| static const char | FORMAT_PREFIX = '%' |
| The character used to prefix formatting commands. More... | |
| static const char | JUSTIFY_LEFT = 'L' |
| The character used to indicate start of left text justification. More... | |
| static const char | JUSTIFY_RIGHT = 'R' |
| The character used to indicate start of right text justification. More... | |
| static const char | MESSAGE = 'M' |
| The character used to indicate that the message should be printed. More... | |
| static const char | TYPE = 'T' |
| The character used to indicate that the message type should be printed. More... | |
| static const char | TIME = 't' |
| The character used to indicate that the message timestamp should be printed. More... | |
| static const char | UTIME = 'u' |
| The character used to indicate that the message timestamp should be printed in UTC time. More... | |
| static const char | SOURCE = 'S' |
| The character used to indicate that the message source should be printed. More... | |
| static const char | SLOT = 's' |
| The character used to indicate that the slot number should be printed. More... | |
| static const char | EVTNUM = 'e' |
| The character used to indicate that the event number should be printed. More... | |
| static const char | THREAD = 'X' |
| The character used to indicate that the thread ID should be printed. More... | |
| static const char | EVENTID = 'E' |
| The character used to indicate that the full event ID should be printed. More... | |
| static const char | FILL = 'F' |
| The character used to indicate that the previous character is used to pad fields if the text is not long enough. More... | |
| static const char | WIDTH = 'W' |
| The character used to indicate that the previous decimal characters should be taken as the field width. More... | |
Friends | |
| std::ostream & | operator<< (std::ostream &stream, const Message &msg) |
| Insert the message into a stream. More... | |
| bool | operator== (const Message &a, const Message &b) |
| Insert the message into a stream. More... | |
The Message class.
This class is used to contain messages which can then be formatted and sent to a message service
|
default |
Default constructor.
| Message::Message | ( | const char * | src, |
| int | type, | ||
| const char * | msg | ||
| ) |
| Message::Message | ( | std::string | src, |
| int | type, | ||
| std::string | msg | ||
| ) |
|
default |
Default destructor.
|
private |
Decode format.
Definition at line 221 of file Message.cpp.
|
static |
Get the default format string.
Definition at line 134 of file Message.cpp.
|
static |
Get the default time format string.
Definition at line 165 of file Message.cpp.
| const std::string & Message::getFormat | ( | ) | const |
| const std::string & Message::getMessage | ( | ) | const |
| const std::string & Message::getSource | ( | ) | const |
| const std::string & Message::getTimeFormat | ( | ) | const |
| int Message::getType | ( | ) | const |
|
private |
Called when an invalid format string is encountered.
Definition at line 329 of file Message.cpp.
|
private |
Format the message.
Definition at line 184 of file Message.cpp.
| bool Message::operator< | ( | const Message & | test | ) |
| void Message::setFormat | ( | std::string | msg | ) | const |
Set the format string.
Definition at line 143 of file Message.cpp.
| void Message::setMessage | ( | std::string | msg | ) |
| void Message::setSource | ( | std::string | src | ) |
| void Message::setTimeFormat | ( | std::string | timeFormat | ) | const |
Set the time format string.
Definition at line 174 of file Message.cpp.
| void Message::setType | ( | int | msg_type | ) |
|
private |
Set the width of a stream.
Definition at line 348 of file Message.cpp.
|
private |
Truncate or pad the output string to the field width as necessary.
Definition at line 363 of file Message.cpp.
|
friend |
Insert the message into a stream.
Definition at line 94 of file Message.cpp.
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |
|
mutableprivate |
|
private |
|
private |
|
mutableprivate |
|
mutableprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |