21 #include <experimental/string_view>
57 std::vector<std::unique_ptr<TLogHandler>>
fHandlers;
61 fHandlers.emplace_back(std::move(lh));
68 void PushFront(std::unique_ptr<TLogHandler> handler) {
69 fHandlers.insert(fHandlers.begin(), std::move(handler));
73 void PushBack(std::unique_ptr<TLogHandler> handler) {
74 fHandlers.emplace_back(std::move(handler));
80 for (
auto&& handler: fHandlers)
81 if (!handler->Emit(entry))
99 fGroup(group), fLevel(level) {}
101 int line, std::string_view funcname):
102 fGroup(group), fFile(filename), fFuncName(funcname), fLine(line),
120 #define R__LOG_HERE(LEVEL, GROUP) \
121 TLogEntry(LEVEL, GROUP).SetFile(__FILE__).SetLine(__LINE__).SetFunction(__PRETTY_FUNCTION__)
124 #define R__ERROR_HERE(GROUP) R__LOG_HERE(ELogLevel::kError, GROUP)
125 #define R__ERROR_HERE(GROUP) R__LOG_HERE(ELogLevel::kError, GROUP)
Informational messages; used for instance for tracing.
Namespace for new ROOT classes and functions.
TLogManager(std::unique_ptr< TLogHandler > &&lh)
Initialize taking a TLogHandlerDefault.
static TLogManager & Get()
void PushBack(std::unique_ptr< TLogHandler > handler)
Add a TLogHandler in the back - to be called after all others.
std::vector< std::unique_ptr< TLogHandler > > fHandlers
static const char * filename()
TLogEntry & SetFile(const std::string &file)
TLogEntry(ELogLevel level, std::string_view group, std::string_view filename, int line, std::string_view funcname)
TLogEntry(ELogLevel level, std::string_view group)
basic_string_view< char > string_view
TLogEntry & SetFunction(const std::string &func)
virtual bool Emit(const TLogEntry &entry)=0
bool Emit(const TLogEntry &entry) override
Debug information; only useful for developers.
double func(double *x, double *p)
ELogLevel
Kinds of diagnostics.
Abstract TLogHandler base class.
TLogEntry & SetLine(int line)
void PushFront(std::unique_ptr< TLogHandler > handler)
Add a TLogHandler in the front - to be called before all others.
Warnings about likely unexpected behavior.