#include <TMsgLogger.h>
Definition at line 47 of file TMsgLogger.h.
◆ TMsgLogger() [1/4]
| Root::TMsgLogger::TMsgLogger |
( |
const TObject * | source, |
|
|
TMsgLevel | minLevel = kINFO ) |
Definition at line 42 of file TMsgLogger.cxx.
49{
50
52}
static const string SUFFIX
static const string::size_type MAXIMUM_SOURCE_NAME_LENGTH
static const string PREFIX
const std::string m_prefix
const std::string m_suffix
const TObject * m_objSource
const std::string::size_type m_maxSourceSize
◆ TMsgLogger() [2/4]
| Root::TMsgLogger::TMsgLogger |
( |
const std::string & | source, |
|
|
TMsgLevel | minLevel = kINFO ) |
◆ TMsgLogger() [3/4]
◆ TMsgLogger() [4/4]
| Root::TMsgLogger::TMsgLogger |
( |
const TMsgLogger & | parent | ) |
|
Definition at line 78 of file TMsgLogger.cxx.
79 : basic_ios< TMsgLogger::char_type, TMsgLogger::traits_type >(),
80 ostringstream(),
81 TObject(),
85{
88}
◆ ~TMsgLogger()
| Root::TMsgLogger::~TMsgLogger |
( |
| ) |
|
|
virtual |
◆ endmsg()
Definition at line 183 of file TMsgLogger.cxx.
184{
185
188}
static Root::TMsgLogger logger("iLumiCalc")
◆ GetFormattedSource()
| string Root::TMsgLogger::GetFormattedSource |
( |
| ) |
const |
Definition at line 104 of file TMsgLogger.cxx.
105{
106
107 string source_name;
110
113 source_name += "...";
114 }
115
116 return source_name;
117}
◆ GetMaxSourceSize()
| UInt_t Root::TMsgLogger::GetMaxSourceSize |
( |
| ) |
const |
|
inline |
◆ GetMinLevel()
| TMsgLevel Root::TMsgLogger::GetMinLevel |
( |
| ) |
const |
|
inline |
Definition at line 67 of file TMsgLogger.h.
static std::atomic< TMsgLevel > m_minLevel
◆ GetMinLevelStr()
| const std::string & Root::TMsgLogger::GetMinLevelStr |
( |
| ) |
const |
|
inline |
Definition at line 68 of file TMsgLogger.h.
std::map< TMsgLevel, std::string > m_levelMap
◆ GetPrintedSource()
| string Root::TMsgLogger::GetPrintedSource |
( |
| ) |
const |
Definition at line 119 of file TMsgLogger.cxx.
120{
121
124 for (string::size_type i=source_name.size(); i<
m_maxSourceSize; i++) source_name.push_back(
' ' );
125
127}
std::string GetFormattedSource() const
◆ GetSource()
| const std::string & Root::TMsgLogger::GetSource |
( |
| ) |
const |
|
inline |
◆ InitMaps()
| void Root::TMsgLogger::InitMaps |
( |
| ) |
|
|
private |
Definition at line 207 of file TMsgLogger.cxx.
208{
216
224}
std::map< TMsgLevel, std::string > m_colorMap
◆ MapLevel()
Definition at line 190 of file TMsgLogger.cxx.
191{
192 TString ins = instr;
193 ins.ToUpper();
194
195
196 std::map<TMsgLevel, std::string>::const_iterator
it =
m_levelMap.begin();
198
199
200 TString
line( Form(
"fatal error in <TMsgLogger::MapLevel> unknown output level: %s ==> abort", ins.Data() ) );
202 abort();
203
205}
◆ operator<<() [1/5]
| TMsgLogger & Root::TMsgLogger::operator<< |
( |
std::ios &(* | _f )(std::ios &) | ) |
|
|
inline |
Definition at line 131 of file TMsgLogger.h.
132 {
133 (_f)(*this);
134 return *this;
135 }
◆ operator<<() [2/5]
| TMsgLogger & Root::TMsgLogger::operator<< |
( |
std::ostream &(* | _f )(std::ostream &) | ) |
|
|
inline |
Definition at line 125 of file TMsgLogger.h.
126 {
127 (_f)(*this);
128 return *this;
129 }
◆ operator<<() [3/5]
template<class T>
| TMsgLogger & Root::TMsgLogger::operator<< |
( |
T | arg | ) |
|
|
inline |
Definition at line 87 of file TMsgLogger.h.
87 {
88 *static_cast<std::ostringstream*>(this) << arg;
89 return *this;
90 }
◆ operator<<() [4/5]
◆ operator<<() [5/5]
Definition at line 120 of file TMsgLogger.h.
121 {
122 return (_f)(*this);
123 }
◆ operator=()
Definition at line 93 of file TMsgLogger.cxx.
94{
95 if (this != &parent) {
99 }
100
101 return *this;
102}
◆ Send()
| void Root::TMsgLogger::Send |
( |
| ) |
|
|
private |
Definition at line 129 of file TMsgLogger.cxx.
130{
131
132
133
135
137 string::size_type previous_pos = 0, current_pos = 0;
138
139
140 for (;;) {
141 current_pos =
message.find(
'\n', previous_pos );
142 string line =
message.substr( previous_pos, current_pos - previous_pos );
143
144 ostringstream message_to_send;
145
146 message_to_send.setf( ios::adjustfield, ios::left );
150
151 if (current_pos ==
message.npos)
break;
152 previous_pos = current_pos + 1;
153 }
154
155
157 return;
158}
void WriteMsg(TMsgLevel level, const std::string &line) const
◆ SetMinLevel()
| void Root::TMsgLogger::SetMinLevel |
( |
TMsgLevel | minLevel | ) |
|
|
inlinestatic |
◆ SetSource() [1/3]
| void Root::TMsgLogger::SetSource |
( |
const char * | source | ) |
|
|
inline |
◆ SetSource() [2/3]
| void Root::TMsgLogger::SetSource |
( |
const std::string & | source | ) |
|
|
inline |
◆ SetSource() [3/3]
| void Root::TMsgLogger::SetSource |
( |
const TString & | source | ) |
|
|
inline |
◆ WriteMsg()
| void Root::TMsgLogger::WriteMsg |
( |
TMsgLevel | level, |
|
|
const std::string & | line ) const |
|
private |
Definition at line 160 of file TMsgLogger.cxx.
161{
163 map<TMsgLevel, std::string>::const_iterator slevel;
165#ifdef USE_COLORED_CONSOLE
166
169 else
171 <<
"<" << slevel->second <<
"> " <<
line <<
"\033[0m" << endl;
172#else
175 else
176 cout <<
m_prefix <<
"<" << slevel->second <<
"> " <<
line << endl;
177#endif
178
179
180 if (mlevel ==
kFATAL) { cout <<
"***> abort program execution" << endl; std::abort(); }
181}
TMsgLevel GetMinLevel() const
◆ m_activeLevel
◆ m_colorMap
| std::map<TMsgLevel, std::string> Root::TMsgLogger::m_colorMap |
|
private |
◆ m_levelMap
| std::map<TMsgLevel, std::string> Root::TMsgLogger::m_levelMap |
|
private |
◆ m_maxSourceSize
| const std::string::size_type Root::TMsgLogger::m_maxSourceSize |
|
private |
◆ m_minLevel
◆ m_objSource
| const TObject* Root::TMsgLogger::m_objSource |
|
private |
◆ m_prefix
| const std::string Root::TMsgLogger::m_prefix |
|
private |
◆ m_strSource
| std::string Root::TMsgLogger::m_strSource |
|
private |
◆ m_suffix
| const std::string Root::TMsgLogger::m_suffix |
|
private |
The documentation for this class was generated from the following files: