38 : m_message(
std::move(
msg ) ), m_source(
std::move( src ) ), m_type(
type ) {}
95 msg.makeFormattedMsg(
msg.m_format );
96 stream <<
msg.m_formatted_msg;
228 switch ( FORMAT_TYPE ) {
230 if ( FORMAT_PARAM.
length() == 1 ) {
339 constexpr
struct all_digit_t {
340 template <
typename C>
341 bool operator()(
const C&
c )
const {
343 [](
typename C::const_reference i ) {
return isdigit( i ); } );
350 if ( all_digits( formatArg ) )
372 for (
int i = 0, j = newText.
length() - 1; i < 3 && j >= 0; ++i, --j ) newText[j] =
'.';
static const char TYPE
The character used to indicate that the message type should be printed.
bool m_left
The message alignment.
static const char MESSAGE
The character used to indicate that the message should be printed.
char m_fill
Current fill character.
static const char JUSTIFY_LEFT
The character used to indicate start of left text justification.
void sizeField(const std::string &text) const
Truncate or pad the output string to the field width as necessary.
void decodeFormat(const std::string &format) const
Decode format.
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
std::string m_formatted_msg
Formatted message.
static const char THREAD
The character used to indicate that the thread ID should be printed.
std::string m_time_format
Time format string.
int getType() const
Get the message type.
Message()=default
Default constructor.
bool operator<(const Message &test)
Needed to build maps.
bool operator==(const Message &a, const Message &b)
Insert the message into a stream.
EventContext::ContextEvt_t m_ecEvt
Event number.
static Time current()
Returns the current time.
std::string m_message
The message text.
void setMessage(std::string msg)
Set the message string.
void setType(int msg_type)
Set the message type.
void setWidth(const std::string &formatArg) const
Set the width of a stream.
EventIDBase m_ecEvtId
Full event ID.
static const char EVENTID
The character used to indicate that the full event ID should be printed.
void setSource(std::string src)
Set the message source.
const std::string & getSource() const
Get the message source.
void setFormat(std::string msg) const
Set the format string.
static constexpr ContextEvt_t INVALID_CONTEXT_EVT
static const std::string getDefaultTimeFormat()
Get the default time format string.
void invalidFormat() const
Called when an invalid format string is encountered.
std::ostream & operator<<(std::ostream &stream, const Message &msg)
Insert the message into a stream.
static const std::string getDefaultFormat()
Get the default format string.
static constexpr ContextID_t INVALID_CONTEXT_ID
static const char EVTNUM
The character used to indicate that the event number should be printed.
EventContext::ContextID_t m_ecSlot
Event slot.
const std::string & getFormat() const
Get the format string.
void makeFormattedMsg(const std::string &format) const
Format the message.
int m_width
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.
std::string format(bool local, std::string spec="%c") const
Format the time using strftime.
static const char JUSTIFY_RIGHT
The character used to indicate start of right text justification.
void setTimeFormat(std::string timeFormat) const
Set the time format string.
static const char UTIME
The character used to indicate that the message timestamp should be printed in UTC time.
static const char SLOT
The character used to indicate that the slot number should be printed.
const std::string & getMessage() const
Get the message string.
pthread_t m_ecThrd
Thread ID.
static const char FILL
The character used to indicate that the previous character is used to pad fields if the text is not l...
Print levels enumeration.
static constexpr const char * DEFAULT_FORMAT
The default message format.
static const char FORMAT_PREFIX
The character used to prefix formatting commands.
std::string m_source
The message 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 (accepts strftime formatters plus %f for milliseconds).
const std::string & getTimeFormat() const
Get the time format string.
int m_type
The message type/level.