| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
Message Class Referencefinal

The Message class. More...

`#include <GaudiKernel/Message.h>`

Collaboration diagram for Message:
[legend]

## 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...

## Detailed Description

The Message class.

This class is used to contain messages which can then be formatted and sent to a message service

Author
  Iain Last

Definition at line 17 of file Message.h.

## Constructor & Destructor Documentation

## ◆ Message() [1/3]

Message::Message | ( |  | ) |
| default

Default constructor.

## ◆ Message() [2/3]

Message::Message | ( | const char * | src,
|  | int | type,
|  | const char * | msg
| ) |  |

Constructor.

Definition at line 29 of file Message.cpp.

29 : m_message( msg ), m_source( src ), m_type( type ) {}
Message::m_message
std::string m_message
The message text.
Definition: Message.h:92
gaudirun.type
type
Definition: gaudirun.py:142
GaudiMP.FdsRegistry.msg
msg
Definition: FdsRegistry.py:8
Message::m_source
std::string m_source
The message source.
Definition: Message.h:93
Message::m_type
int m_type
The message type/level.
Definition: Message.h:94

## ◆ Message() [3/3]

Message::Message | ( | std::string | src,
|  | int | type,
|  | std::string | msg
| ) |  |

Constructor.

Definition at line 37 of file Message.cpp.

38 : m_message( std::move( msg ) ), m_source( std::move( src ) ), m_type( type ) {}
Message::m_message
std::string m_message
The message text.
Definition: Message.h:92
gaudirun.type
type
Definition: gaudirun.py:142
std::move
T move(T... args)
GaudiMP.FdsRegistry.msg
msg
Definition: FdsRegistry.py:8
Message::m_source
std::string m_source
The message source.
Definition: Message.h:93
Message::m_type
int m_type
The message type/level.
Definition: Message.h:94

## ◆ ~Message()

Message::~Message | ( |  | ) |
| default

Default destructor.

## Member Function Documentation

## ◆ decodeFormat()

void Message::decodeFormat | ( | const std::string & | format | ) | const
| private

Decode format.

Definition at line 221 of file Message.cpp.

221 {
222 if ( !format.empty() ) {
223 const char FORMAT_TYPE = format[format.length() - 1];
224 const std::string FORMAT_PARAM = format.substr( 0, format.length() - 1 );
225
226 // Now test the format.
227 std::string level;
228 switch ( FORMAT_TYPE ) {
229 case FILL:
230 if ( FORMAT_PARAM.length() == 1 ) {
231 m_fill = FORMAT_PARAM[0];
232 } else
233 invalidFormat();
234 break;
235
236 case TIME: {
237 sizeField( formattedTime( m_time_format ) );
238 } break;
239
240 case UTIME: {
241 sizeField( formattedTime( m_time_format, true ) );
242 } break;
243
244 case THREAD: {
245 std::ostringstream ost;
246 // ost << "0x" << std::hex << pthread_self();
247 ost << "0x" << std::hex << m_ecThrd;
248 const std::string& thrStr( ost.str() );
249 sizeField( thrStr );
250 } break;
251
252 case SLOT: {
253 std::ostringstream ost;
254 if ( m_ecSlot != EventContext::INVALID_CONTEXT_ID ) { ost << m_ecSlot; }
255 sizeField( ost.str() );
256 } break;
257
258 case EVTNUM: {
259 std::ostringstream ost;
260 if ( m_ecEvt != EventContext::INVALID_CONTEXT_EVT ) { ost << m_ecEvt; }
261 sizeField( ost.str() );
262 } break;
263
264 case EVENTID: {
265 std::ostringstream ost;
266 if ( m_ecEvtId.isValid() ) { ost << m_ecEvtId; }
267 sizeField( ost.str() );
268 } break;
269
270 case MESSAGE:
271 sizeField( m_message );
272 break;
273
274 case SOURCE:
275 sizeField( m_source );
276 break;
277
278 case TYPE:
279 switch ( m_type ) {
280 #define SET( x ) \
281 case x: \
282 level = #x; \
283 break
284 SET( NIL );
285 SET( VERBOSE );
286 SET( DEBUG );
287 SET( INFO );
288 SET( WARNING );
289 SET( ERROR );
290 SET( FATAL );
291 case ALWAYS:
292 level = "SUCCESS";
293 break;
294 default:
295 level = "UNKNOWN";
296 break;
297 #undef SET
298 }
299 sizeField( level );
300 break;
301
302 case FORMAT_PREFIX:
303 m_formatted_msg += FORMAT_PREFIX;
304 break;
305 case JUSTIFY_RIGHT:
306 m_left = false;
307 break;
308 case JUSTIFY_LEFT:
309 m_left = true;
310 break;
311 case WIDTH:
312 setWidth( FORMAT_PARAM );
313 break;
314 default:
315 invalidFormat();
316 break;
317 }
318 } else
319 invalidFormat();
320 }
Message::TYPE
static const char TYPE
The character used to indicate that the message type should be printed.
Definition: Message.h:125
Message::m_left
bool m_left
The message alignment.
Definition: Message.h:100
Message::MESSAGE
static const char MESSAGE
The character used to indicate that the message should be printed.
Definition: Message.h:122
Message::m_fill
char m_fill
Current fill character.
Definition: Message.h:98
Message::JUSTIFY_LEFT
static const char JUSTIFY_LEFT
The character used to indicate start of left text justification.
Definition: Message.h:116
std::string::empty
T empty(T... args)
Message::sizeField
void sizeField(const std::string &text) const
Truncate or pad the output string to the field width as necessary.
Definition: Message.cpp:363
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:109
Message::m_formatted_msg
std::string m_formatted_msg
Formatted message.
Definition: Message.h:97
Message::THREAD
static const char THREAD
The character used to indicate that the thread ID should be printed.
Definition: Message.h:143
Message::m_time_format
std::string m_time_format
Time format string.
Definition: Message.h:96
Message::m_ecEvt
EventContext::ContextEvt_t m_ecEvt
Event number.
Definition: Message.h:105
MSG::DEBUG
Definition: IMessageSvc.h:15
Message::m_message
std::string m_message
The message text.
Definition: Message.h:92
Message::setWidth
void setWidth(const std::string &formatArg) const
Set the width of a stream.
Definition: Message.cpp:348
SET
#define SET(x)
Message::m_ecEvtId
EventIDBase m_ecEvtId
Full event ID.
Definition: Message.h:106
MSG::VERBOSE
Definition: IMessageSvc.h:15
Message::EVENTID
static const char EVENTID
The character used to indicate that the full event ID should be printed.
Definition: Message.h:146
std::string
STL class.
MSG::FATAL
Definition: IMessageSvc.h:15
EventContext::INVALID_CONTEXT_EVT
static constexpr ContextEvt_t INVALID_CONTEXT_EVT
Definition: EventContext.h:30
Message::invalidFormat
void invalidFormat() const
Called when an invalid format string is encountered.
Definition: Message.cpp:329
std::ostringstream
STL class.
MSG::NIL
Definition: IMessageSvc.h:15
EventContext::INVALID_CONTEXT_ID
static constexpr ContextID_t INVALID_CONTEXT_ID
Definition: EventContext.h:29
std::ostringstream::str
T str(T... args)
Message::EVTNUM
static const char EVTNUM
The character used to indicate that the event number should be printed.
Definition: Message.h:140
Message::m_ecSlot
EventContext::ContextID_t m_ecSlot
Event slot.
Definition: Message.h:104
EventIDBase::isValid
bool isValid() const
Definition: EventIDBase.h:147
Message::TIME
static const char TIME
The character used to indicate that the message timestamp should be printed.
Definition: Message.h:128
std::string::length
T length(T... args)
Message::JUSTIFY_RIGHT
static const char JUSTIFY_RIGHT
The character used to indicate start of right text justification.
Definition: Message.h:119
Message::UTIME
static const char UTIME
The character used to indicate that the message timestamp should be printed in UTC time.
Definition: Message.h:131
Message::SLOT
static const char SLOT
The character used to indicate that the slot number should be printed.
Definition: Message.h:137
Message::m_ecThrd
pthread_t m_ecThrd
Thread ID.
Definition: Message.h:107
Message::FILL
static const char FILL
The character used to indicate that the previous character is used to pad fields if the text is not l...
Definition: Message.h:149
std::hex
T hex(T... args)
MSG::ERROR
Definition: IMessageSvc.h:15
std::string::substr
T substr(T... args)
gaudirun.level
level
Definition: gaudirun.py:334
MSG::WARNING
Definition: IMessageSvc.h:15
MSG::INFO
Definition: IMessageSvc.h:15
Message::FORMAT_PREFIX
static const char FORMAT_PREFIX
The character used to prefix formatting commands.
Definition: Message.h:113
Message::m_source
std::string m_source
The message source.
Definition: Message.h:93
Message::WIDTH
static const char WIDTH
The character used to indicate that the previous decimal characters should be taken as the field widt...
Definition: Message.h:152
Message::SOURCE
static const char SOURCE
The character used to indicate that the message source should be printed.
Definition: Message.h:134
MSG::ALWAYS
Definition: IMessageSvc.h:15
Message::m_type
int m_type
The message type/level.
Definition: Message.h:94

## ◆ getDefaultFormat()

const std::string Message::getDefaultFormat | ( |  | ) |
| static

Get the default format string.

Definition at line 134 of file Message.cpp.

134 { return DEFAULT_FORMAT; }
Message::DEFAULT_FORMAT
static constexpr const char * DEFAULT_FORMAT
The default message format.
Definition: Message.h:156

## ◆ getDefaultTimeFormat()

const std::string Message::getDefaultTimeFormat | ( |  | ) |
| static

Get the default time format string.

Definition at line 165 of file Message.cpp.

165 { return DEFAULT_TIME_FORMAT; }
Message::DEFAULT_TIME_FORMAT
static constexpr const char * DEFAULT_TIME_FORMAT
The default time format (accepts strftime formatters plus %f for milliseconds).
Definition: Message.h:159

## ◆ getFormat()

const std::string & Message::getFormat | ( |  | ) | const

Get the format string.

Definition at line 126 of file Message.cpp.

126 { return m_format; }
Message::m_format
std::string m_format
The format string.
Definition: Message.h:95

## ◆ getMessage()

const std::string & Message::getMessage | ( |  | ) | const

Get the message string.

Definition at line 46 of file Message.cpp.

46 { return m_message; }
Message::m_message
std::string m_message
The message text.
Definition: Message.h:92

## ◆ getSource()

const std::string & Message::getSource | ( |  | ) | const

Get the message source.

Definition at line 78 of file Message.cpp.

78 { return m_source; }
Message::m_source
std::string m_source
The message source.
Definition: Message.h:93

## ◆ getTimeFormat()

const std::string & Message::getTimeFormat | ( |  | ) | const

Get the time format string.

Definition at line 157 of file Message.cpp.

157 { return m_time_format; }
Message::m_time_format
std::string m_time_format
Time format string.
Definition: Message.h:96

## ◆ getType()

int Message::getType | ( |  | ) | const

Get the message type.

Definition at line 62 of file Message.cpp.

62 { return m_type; }
Message::m_type
int m_type
The message type/level.
Definition: Message.h:94

## ◆ invalidFormat()

void Message::invalidFormat | ( |  | ) | const
| private

Called when an invalid format string is encountered.

Definition at line 329 of file Message.cpp.

329 { makeFormattedMsg( DEFAULT_FORMAT ); }
Message::makeFormattedMsg
void makeFormattedMsg(const std::string &format) const
Format the message.
Definition: Message.cpp:184
Message::DEFAULT_FORMAT
static constexpr const char * DEFAULT_FORMAT
The default message format.
Definition: Message.h:156

## ◆ makeFormattedMsg()

void Message::makeFormattedMsg | ( | const std::string & | format | ) | const
| private

Format the message.

Definition at line 184 of file Message.cpp.

184 {
185 m_formatted_msg.clear();
186 auto i = format.begin();
187 while ( i != format.end() ) {
188
189 // Output format string until format statement found.
190 while ( i != format.end() && *i != FORMAT_PREFIX ) m_formatted_msg += *i++;
191
192 // Test for end of format string.
193 if ( i == format.end() ) break;
194 i++;
195
196 // Find type of formatting.
197 std::string this_format;
198 while ( i != format.end() && *i != FORMAT_PREFIX && *i != MESSAGE && *i != TYPE && *i != SOURCE && *i != FILL &&
199 *i != WIDTH && *i != TIME && *i != UTIME && *i != SLOT && *i != EVTNUM && *i != THREAD && *i != EVENTID &&
200 *i != JUSTIFY_LEFT && *i != JUSTIFY_RIGHT ) {
201 this_format += *i++;
202 }
203
204 // Reached end of string with improper format.
205 if ( i == format.end() ) {
206 invalidFormat();
207 break;
208 }
209
210 this_format += *i++;
211 decodeFormat( this_format );
212 }
213 }
Message::TYPE
static const char TYPE
The character used to indicate that the message type should be printed.
Definition: Message.h:125
Message::MESSAGE
static const char MESSAGE
The character used to indicate that the message should be printed.
Definition: Message.h:122
Message::JUSTIFY_LEFT
static const char JUSTIFY_LEFT
The character used to indicate start of left text justification.
Definition: Message.h:116
Message::decodeFormat
void decodeFormat(const std::string &format) const
Decode format.
Definition: Message.cpp:221
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:109
Message::m_formatted_msg
std::string m_formatted_msg
Formatted message.
Definition: Message.h:97
Message::THREAD
static const char THREAD
The character used to indicate that the thread ID should be printed.
Definition: Message.h:143
std::string::end
T end(T... args)
Message::EVENTID
static const char EVENTID
The character used to indicate that the full event ID should be printed.
Definition: Message.h:146
std::string
STL class.
Message::invalidFormat
void invalidFormat() const
Called when an invalid format string is encountered.
Definition: Message.cpp:329
Message::EVTNUM
static const char EVTNUM
The character used to indicate that the event number should be printed.
Definition: Message.h:140
std::string::clear
T clear(T... args)
Message::TIME
static const char TIME
The character used to indicate that the message timestamp should be printed.
Definition: Message.h:128
Message::JUSTIFY_RIGHT
static const char JUSTIFY_RIGHT
The character used to indicate start of right text justification.
Definition: Message.h:119
Message::UTIME
static const char UTIME
The character used to indicate that the message timestamp should be printed in UTC time.
Definition: Message.h:131
Message::SLOT
static const char SLOT
The character used to indicate that the slot number should be printed.
Definition: Message.h:137
std::string::begin
T begin(T... args)
Message::FILL
static const char FILL
The character used to indicate that the previous character is used to pad fields if the text is not l...
Definition: Message.h:149
Message::FORMAT_PREFIX
static const char FORMAT_PREFIX
The character used to prefix formatting commands.
Definition: Message.h:113
Message::WIDTH
static const char WIDTH
The character used to indicate that the previous decimal characters should be taken as the field widt...
Definition: Message.h:152
Message::SOURCE
static const char SOURCE
The character used to indicate that the message source should be printed.
Definition: Message.h:134

## ◆ operator<()

bool Message::operator< | ( | const Message & | test | ) |

Needed to build maps.

Definition at line 106 of file Message.cpp.

106 {
107 return m_type < b.m_type || m_source < b.m_source || m_message < b.m_message;
108 }
Message::m_message
std::string m_message
The message text.
Definition: Message.h:92
Message::m_source
std::string m_source
The message source.
Definition: Message.h:93
Message::m_type
int m_type
The message type/level.
Definition: Message.h:94

## ◆ setFormat()

void Message::setFormat | ( | std::string | msg | ) | const

Set the format string.

Definition at line 143 of file Message.cpp.

143 {
144 if ( LIKELY( !format.empty() ) ) {
145 m_format = std::move( format );
146 } else {
147 m_format = DEFAULT_FORMAT;
148 }
149 }
std::string::empty
T empty(T... args)
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:109
std::move
T move(T... args)
LIKELY
#define LIKELY(x)
Definition: Kernel.h:95
Message::m_format
std::string m_format
The format string.
Definition: Message.h:95
Message::DEFAULT_FORMAT
static constexpr const char * DEFAULT_FORMAT
The default message format.
Definition: Message.h:156

## ◆ setMessage()

void Message::setMessage | ( | std::string | msg | ) |

Set the message string.

Definition at line 54 of file Message.cpp.

54 { m_message = std::move( msg ); }
Message::m_message
std::string m_message
The message text.
Definition: Message.h:92
std::move
T move(T... args)
GaudiMP.FdsRegistry.msg
msg
Definition: FdsRegistry.py:8

## ◆ setSource()

void Message::setSource | ( | std::string | src | ) |

Set the message source.

Definition at line 86 of file Message.cpp.

86 { m_source = std::move( src ); }
std::move
T move(T... args)
Message::m_source
std::string m_source
The message source.
Definition: Message.h:93

## ◆ setTimeFormat()

void Message::setTimeFormat | ( | std::string | timeFormat | ) | const

Set the time format string.

Definition at line 174 of file Message.cpp.

174 {
175 m_time_format = ( timeFormat.empty() ? DEFAULT_TIME_FORMAT : std::move( timeFormat ) );
176 }
std::string::empty
T empty(T... args)
Message::m_time_format
std::string m_time_format
Time format string.
Definition: Message.h:96
std::move
T move(T... args)
Message::DEFAULT_TIME_FORMAT
static constexpr const char * DEFAULT_TIME_FORMAT
The default time format (accepts strftime formatters plus %f for milliseconds).
Definition: Message.h:159

## ◆ setType()

void Message::setType | ( | int | msg_type | ) |

Set the message type.

Definition at line 70 of file Message.cpp.

70 { m_type = msg_type; }
Message::m_type
int m_type
The message type/level.
Definition: Message.h:94

## ◆ setWidth()

void Message::setWidth | ( | const std::string & | formatArg | ) | const
| private

Set the width of a stream.

Definition at line 348 of file Message.cpp.

348 {
349 // Convert string to int, if string contains digits only...
350 if ( all_digits( formatArg ) )
351 m_width = std::stoi( formatArg );
352 else
353 invalidFormat();
354 }
Message::invalidFormat
void invalidFormat() const
Called when an invalid format string is encountered.
Definition: Message.cpp:329
Message::m_width
int m_width
Current field width.
Definition: Message.h:99
std::stoi
T stoi(T... args)

## ◆ sizeField()

void Message::sizeField | ( | const std::string & | text | ) | const
| private

Truncate or pad the output string to the field width as necessary.

Definition at line 363 of file Message.cpp.

363 {
364 std::string newText;
365 if ( m_width == 0 || m_width == static_cast<int>( text.length() ) ) {
366 newText = text;
367 } else {
368
369 // Truncate the text if it is too long.
370 if ( m_width < static_cast<int>( text.length() ) ) {
371 newText = text.substr( 0, m_width );
372 for ( int i = 0, j = newText.length() - 1; i < 3 && j >= 0; ++i, --j ) newText[j] = '.';
373 }
374
375 // Pad the text.
376 else {
377 newText = std::string( m_width, m_fill );
378 if ( m_left )
379 newText.replace( newText.begin(), newText.begin() + text.length(), text.begin(), text.end() );
380 else
381 newText.replace( newText.end() - text.length(), newText.end(), text.begin(), text.end() );
382 }
383 }
384
385 m_formatted_msg += newText;
386 }
Message::m_left
bool m_left
The message alignment.
Definition: Message.h:100
Message::m_fill
char m_fill
Current fill character.
Definition: Message.h:98
Message::m_formatted_msg
std::string m_formatted_msg
Formatted message.
Definition: Message.h:97
std::string::end
T end(T... args)
std::string
STL class.
std::string::replace
T replace(T... args)
Message::m_width
int m_width
Current field width.
Definition: Message.h:99
std::string::length
T length(T... args)
std::string::begin
T begin(T... args)
std::string::substr
T substr(T... args)

## Friends And Related Function Documentation

## ◆ operator<<

std::ostream& operator<< | ( | std::ostream & | stream,
|  | const Message & | msg
| ) |  |
| friend

Insert the message into a stream.

Definition at line 94 of file Message.cpp.

94 {
95 msg.makeFormattedMsg( msg.m_format );
96 stream << msg.m_formatted_msg;
97 return stream;
98 }
GaudiMP.FdsRegistry.msg
msg
Definition: FdsRegistry.py:8

## ◆ operator==

bool operator== | ( | const Message & | a,
|  | const Message & | b
| ) |  |
| friend

Insert the message into a stream.

Definition at line 116 of file Message.cpp.

116 {
117 return a.m_source == b.m_source && a.m_type == b.m_type && a.m_message == b.m_message;
118 }
Message::m_message
std::string m_message
The message text.
Definition: Message.h:92
Message::m_source
std::string m_source
The message source.
Definition: Message.h:93
Message::m_type
int m_type
The message type/level.
Definition: Message.h:94

## Member Data Documentation

## ◆ DEFAULT_FORMAT

constexpr const char* Message::DEFAULT_FORMAT = "% F%18W%S%7W%R%T %0W%M"
| static private

The default message format.

Definition at line 156 of file Message.h.

## ◆ DEFAULT_TIME_FORMAT

constexpr const char* Message::DEFAULT_TIME_FORMAT = "%Y-%m-%d %H:%M:%S,%f"
| static private

The default time format (accepts strftime formatters plus %f for milliseconds).

Definition at line 159 of file Message.h.

## ◆ EVENTID

const char Message::EVENTID = 'E'
| static private

The character used to indicate that the full event ID should be printed.

Definition at line 146 of file Message.h.

## ◆ EVTNUM

const char Message::EVTNUM = 'e'
| static private

The character used to indicate that the event number should be printed.

Definition at line 140 of file Message.h.

## ◆ FILL

const char Message::FILL = 'F'
| static private

The character used to indicate that the previous character is used to pad fields if the text is not long enough.

Definition at line 149 of file Message.h.

## ◆ FORMAT_PREFIX

const char Message::FORMAT_PREFIX = '%'
| static private

The character used to prefix formatting commands.

Definition at line 113 of file Message.h.

## ◆ JUSTIFY_LEFT

const char Message::JUSTIFY_LEFT = 'L'
| static private

The character used to indicate start of left text justification.

Definition at line 116 of file Message.h.

## ◆ JUSTIFY_RIGHT

const char Message::JUSTIFY_RIGHT = 'R'
| static private

The character used to indicate start of right text justification.

Definition at line 119 of file Message.h.

## ◆ m_ecEvt

EventContext::ContextEvt_t Message::m_ecEvt {Gaudi::Hive::currentContext().evt()}
| private

Event number.

Definition at line 105 of file Message.h.

## ◆ m_ecEvtId

EventIDBase Message::m_ecEvtId {Gaudi::Hive::currentContext().eventID()}
| private

Full event ID.

Definition at line 106 of file Message.h.

## ◆ m_ecSlot

EventContext::ContextID_t Message::m_ecSlot {Gaudi::Hive::currentContext().slot()}
| private

Event slot.

Definition at line 104 of file Message.h.

## ◆ m_ecThrd

pthread_t Message::m_ecThrd {pthread_self()}
| private

Thread ID.

Definition at line 107 of file Message.h.

## ◆ m_fill

char Message::m_fill {' '}
| mutable private

Current fill character.

Definition at line 98 of file Message.h.

## ◆ m_format

std::string Message::m_format {DEFAULT_FORMAT}
| mutable private

The format string.

Definition at line 95 of file Message.h.

## ◆ m_formatted_msg

std::string Message::m_formatted_msg
| mutable private

Formatted message.

Definition at line 97 of file Message.h.

## ◆ m_left

bool Message::m_left {true}
| mutable private

The message alignment.

Definition at line 100 of file Message.h.

## ◆ m_message

std::string Message::m_message
| private

The message text.

Definition at line 92 of file Message.h.

## ◆ m_source

std::string Message::m_source {"UNKNOWN"}
| private

The message source.

Definition at line 93 of file Message.h.

## ◆ m_time_format

std::string Message::m_time_format {DEFAULT_TIME_FORMAT}
| mutable private

Time format string.

Definition at line 96 of file Message.h.

## ◆ m_type

int Message::m_type {0}
| private

The message type/level.

Definition at line 94 of file Message.h.

## ◆ m_width

int Message::m_width {0}
| mutable private

Current field width.

Definition at line 99 of file Message.h.

## ◆ MESSAGE

const char Message::MESSAGE = 'M'
| static private

The character used to indicate that the message should be printed.

Definition at line 122 of file Message.h.

## ◆ SLOT

const char Message::SLOT = 's'
| static private

The character used to indicate that the slot number should be printed.

Definition at line 137 of file Message.h.

## ◆ SOURCE

const char Message::SOURCE = 'S'
| static private

The character used to indicate that the message source should be printed.

Definition at line 134 of file Message.h.

## ◆ THREAD

const char Message::THREAD = 'X'
| static private

The character used to indicate that the thread ID should be printed.

Definition at line 143 of file Message.h.

## ◆ TIME

const char Message::TIME = 't'
| static private

The character used to indicate that the message timestamp should be printed.

Definition at line 128 of file Message.h.

## ◆ TYPE

const char Message::TYPE = 'T'
| static private

The character used to indicate that the message type should be printed.

Definition at line 125 of file Message.h.

## ◆ UTIME

const char Message::UTIME = 'u'
| static private

The character used to indicate that the message timestamp should be printed in UTC time.

Definition at line 131 of file Message.h.

## ◆ WIDTH

const char Message::WIDTH = 'W'
| static private

The character used to indicate that the previous decimal characters should be taken as the field width.

Definition at line 152 of file Message.h.

The documentation for this class was generated from the following files:

- GaudiKernel/GaudiKernel/Message.h
- GaudiKernel/src/Lib/Message.cpp