26 namespace Experimental {
49 virtual bool Emit(
const TLogEntry& entry) = 0;
55 std::vector<std::unique_ptr<TLogHandler>>
fHandlers;
59 fHandlers.emplace_back(std::move(lh));
66 void PushFront(std::unique_ptr<TLogHandler> handler) {
67 fHandlers.insert(fHandlers.begin(), std::move(handler));
71 void PushBack(std::unique_ptr<TLogHandler> handler) {
72 fHandlers.emplace_back(std::move(handler));
78 for (
auto&& handler: fHandlers)
79 if (!handler->Emit(entry))
97 fGroup(group), fLevel(level) {}
100 fGroup(group), fFile(filename), fFuncName(funcname), fLine(line),
118 #define R__LOG_HERE(LEVEL, GROUP) \ 119 ROOT::Experimental::TLogEntry(LEVEL, GROUP).SetFile(__FILE__).SetLine(__LINE__).SetFunction(__PRETTY_FUNCTION__) 121 #define R__FATAL_HERE(GROUP) R__LOG_HERE(ROOT::Experimental::ELogLevel::kFatal, GROUP) 122 #define R__ERROR_HERE(GROUP) R__LOG_HERE(ROOT::Experimental::ELogLevel::kError, GROUP) 123 #define R__WARNING_HERE(GROUP) R__LOG_HERE(ROOT::Experimental::ELogLevel::kWarning, GROUP) 124 #define R__INFO_HERE(GROUP) R__LOG_HERE(ROOT::Experimental::ELogLevel::kInfo, GROUP) 125 #define R__DEBUG_HERE(GROUP) R__LOG_HERE(ROOT::Experimental::ELogLevel::kDebug, GROUP) TLogEntry & SetLine(int line)
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
TLogEntry(ELogLevel level, std::string_view group)
void PushBack(std::unique_ptr< TLogHandler > handler)
Add a TLogHandler in the back - to be called after all others.
void PushFront(std::unique_ptr< TLogHandler > handler)
Add a TLogHandler in the front - to be called before all others.
TLogEntry(ELogLevel level, std::string_view group, std::string_view filename, int line, std::string_view funcname)
bool Emit(const TLogEntry &entry) override
TLogEntry & SetFile(const std::string &file)
TLogManager(std::unique_ptr< TLogHandler > &&lh)
Initialize taking a TLogHandlerDefault.
Informational messages; used for instance for tracing.
static TLogManager & Get()
std::vector< std::unique_ptr< TLogHandler > > fHandlers
Warnings about likely unexpected behavior.
Abstract TLogHandler base class.
double func(double *x, double *p)
TLogEntry & SetFunction(const std::string &func)
Debug information; only useful for developers.
ELogLevel
Kinds of diagnostics.