1 #ifndef GAUDIKERNEL_MESSAGE_H
2 #define GAUDIKERNEL_MESSAGE_H
29 const std::string& getMessage()
const;
32 void setMessage( std::string
msg );
38 void setType(
int msg_type );
41 const std::string& getSource()
const;
44 void setSource( std::string src );
47 const std::string& getFormat()
const;
50 static const std::string getDefaultFormat();
53 void setFormat( std::string
msg )
const;
56 const std::string& getTimeFormat()
const;
59 static const std::string getDefaultTimeFormat() ;
62 void setTimeFormat( std::string timeFormat )
const;
75 void invalidFormat()
const;
78 void makeFormattedMsg(
const std::string&
format )
const;
81 void decodeFormat(
const std::string&
format )
const;
84 void sizeField(
const std::string& text )
const;
87 void setWidth(
const std::string& formatArg )
const;
90 std::string m_message;
93 std::string m_source =
"UNKNOWN";
96 mutable std::string m_format = DEFAULT_FORMAT;
99 mutable std::string m_time_format = DEFAULT_TIME_FORMAT;
105 mutable std::string m_formatted_msg;
108 mutable char m_fill =
' ';
111 mutable int m_width = 0;
114 mutable bool m_left =
true;
119 static const char FORMAT_PREFIX =
'%';
122 static const char JUSTIFY_LEFT =
'L';
125 static const char JUSTIFY_RIGHT =
'R';
128 static const char MESSAGE =
'M';
131 static const char TYPE =
'T';
134 static const char TIME =
't';
138 static const char UTIME =
'u';
141 static const char SOURCE =
'S';
146 static const char FILL =
'F';
151 static const char WIDTH =
'W';
155 static constexpr
const char* DEFAULT_FORMAT =
"% F%18W%S%7W%R%T %0W%M";
159 static constexpr
const char* DEFAULT_TIME_FORMAT =
"%Y-%m-%d %H:%M:%S,%f";
162 static const char SLOT =
's';
163 static const char EVTNUM =
'e';
164 static const char THREAD =
'X';
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
GAUDI_API std::ostream & operator<<(std::ostream &stream, const Message &msg)
Insert the message into a stream.
GAUDI_API bool operator==(const Message &a, const Message &b)
Insert the message into a stream.
bool operator<(const Gaudi::Time &t1, const Gaudi::Time &t2)