34 m_ecThrd = pthread_self();
44 m_message( msg ), m_source( src ), m_type( type )
254 auto i = format.
begin();
255 while( i != format.
end() ) {
262 if ( i == format.
end() )
break;
276 if ( i == format.
end() ) {
294 if ( ! format.
empty() ) {
295 const char FORMAT_TYPE = format[ format.
length() - 1 ];
300 switch( FORMAT_TYPE ) {
302 if ( FORMAT_PARAM.
length() == 1 ) {
369 #define SET(x) case x: level=#x; break 377 case ALWAYS: level=
"SUCCESS";
break;
417 constexpr
struct all_digit_t {
418 template <
typename C>
421 [](
typename C::const_reference i) {
454 for (
int i = 0, j = newText.
length()-1; i < 3 && j >= 0; ++i, --j )
static const char TYPE
The character used to indicate that the message type should be printed.
bool m_left
Justification.
static const char MESSAGE
The character used to indicate that the message should be printed.
const std::string & getFormat() const
Get the format string.
char m_fill
The current fill character.
static const char JUSTIFY_LEFT
The character used to indicate start of left text justification.
GAUDI_API ContextIdType currentContextId()
Return the current context id.
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
std::string m_formatted_msg
Formatted message.
std::string m_time_format
Time format string.
void decodeFormat(const std::string &format) const
Decode format.
void setWidth(const std::string &formatArg) const
Set the width of a stream.
bool operator<(const Message &test)
Needed to build maps.
static Time current(void)
Returns the current time.
std::string m_message
The message.
void setMessage(std::string msg)
Set the message string.
void setType(int msg_type)
Set the message type.
int getType() const
Get the message type.
Message()
Default constructor.
friend std::ostream & operator<<(std::ostream &stream, const Message &msg)
Insert the message into a stream.
void setSource(std::string src)
Set the message source.
void invalidFormat() const
Called when an invalid format string is encountered.
static const std::string getDefaultTimeFormat()
Get the default time format string.
static const std::string getDefaultFormat()
Get the default format string.
friend bool operator==(const Message &a, const Message &b)
Insert the message into a stream.
int m_width
The current field width.
static const char TIME
The character used to indicate that the message timestamp should be printed.
std::string m_format
The format string.
GAUDI_API ContextIdType currentContextEvt()
void setFormat(std::string msg) const
Set the format string.
static const char JUSTIFY_RIGHT
The character used to indicate start of right text justification.
static const char UTIME
The character used to indicate that the message timestamp should be printed in UTC time...
virtual Out operator()(const vector_of_const_< In > &inputs) const =0
static const char SLOT
For slot and event number from EventContext.
static const char FILL
The character used to indicate that the previous character is to be used for padding out fields if th...
void makeFormattedMsg(const std::string &format) const
Format the message.
Print levels enumeration.
void setTimeFormat(std::string timeFormat) const
Set the time format string.
void sizeField(const std::string &text) const
Truncate or pad the output string to the field width as necessary.
const std::string & getSource() const
Get the message source.
const std::string & getTimeFormat() const
Get the time format string.
static constexpr const char * DEFAULT_FORMAT
The default message format.
static const char FORMAT_PREFIX
Formatting string characters.
std::string m_source
The source.
static const char WIDTH
The character used to indicate that the previous decimal characters should be taken as the field widt...
static const char SOURCE
The character used to indicate that the message source should be printed.
static constexpr const char * DEFAULT_TIME_FORMAT
The default time format.
std::string format(bool local, std::string spec="%c") const
Format the time using strftime.
const std::string & getMessage() const
Get the message string.