1 #include "utl/ErrorLogger.h"
16 fBaseDirLength(string(__FILE__).size() - string(
"Utilities/ErrorLogger/ErrorLogger.cc").size()),
17 fColorOutput(isatty(fileno(stderr)))
61 const char*
const names[] = {
62 "\033[1;35m[DEBUG]\033[0m",
63 "\033[1;34m[INFO]\033[0m",
64 "\033[1;36m[WARN]\033[0m",
65 "\033[1;31m[ERROR]\033[0m",
66 "\033[1;31m[FATAL]\033[0m"
70 const char*
const names[] = {
90 const string& functionName,
91 const string& fileName,
93 const string& message,
111 <<
':' << lineNumber <<
": ";
114 temp << functionName <<
": ";
117 temp << message << endl;
118 const string line = temp.str();
135 output <<
"\n\033[1;36mSummary of previous errors:\033[0m\n";
137 output <<
"\nSummary of previous errors:\n";
138 const int maxLines = 50;
141 const auto& message = mn.first;
142 const auto& count = mn.second;
143 output <<
"\033[1;36m" << count <<
"x\033[0m " << message;
145 if (nLines >= maxLines) {
148 warn <<
"List of previous errors was truncated at the " << nLines <<
" lines "
149 "out of total " << fListOfErrorMessages.size();
void Log(const ESeverityLevel severity, const std::string &functionName, const std::string &fileName, const int lineNumber, const std::string &message, EVerbosity verbosity=Verbosity::eDefault, bool stripBaseDir=true) const
General interface for logging a message.
Include filename and line number.
ESeverityLevel fMinSeverity
void WriteErrorMessagesToStream()
std::map< std::string, int > fListOfErrorMessages
Include function or facility name.
unsigned int fBaseDirLength
#define WARNING(message)
Macro for logging warning messages.
std::ostream * fOStream
Current stream for logging messages.
Report severity level of message.
ESeverityLevel
Message severity levels.
std::string GetSeverityName(const ESeverityLevel severity) const
Get string name for severity level.
use default verbosity from error logger