26 namespace Experimental {
49 virtual bool Emit(
const TLogEntry &entry) = 0;
54 std::vector<std::unique_ptr<TLogHandler>>
fHandlers;
57 TLogManager(std::unique_ptr<TLogHandler> &&lh) { fHandlers.emplace_back(std::move(lh)); }
63 void PushFront(std::unique_ptr<TLogHandler> handler) { fHandlers.insert(fHandlers.begin(), std::move(handler)); }
66 void PushBack(std::unique_ptr<TLogHandler> handler) { fHandlers.emplace_back(std::move(handler)); }
72 for (
auto &&handler: fHandlers)
73 if (!handler->Emit(entry))
91 : fGroup(group), fFile(filename), fFuncName(funcname), fLine(line), fLevel(level)
116 #if defined(_MSC_VER) 117 #define R__LOG_PRETTY_FUNCTION __FUNCSIG__ 119 #define R__LOG_PRETTY_FUNCTION __PRETTY_FUNCTION__ 122 #define R__LOG_HERE(LEVEL, GROUP) \ 123 ROOT::Experimental::TLogEntry(LEVEL, GROUP).SetFile(__FILE__).SetLine(__LINE__).SetFunction(R__LOG_PRETTY_FUNCTION) 125 #define R__FATAL_HERE(GROUP) R__LOG_HERE(ROOT::Experimental::ELogLevel::kFatal, GROUP) 126 #define R__ERROR_HERE(GROUP) R__LOG_HERE(ROOT::Experimental::ELogLevel::kError, GROUP) 127 #define R__WARNING_HERE(GROUP) R__LOG_HERE(ROOT::Experimental::ELogLevel::kWarning, GROUP) 128 #define R__INFO_HERE(GROUP) R__LOG_HERE(ROOT::Experimental::ELogLevel::kInfo, GROUP) 129 #define R__DEBUG_HERE(GROUP) R__LOG_HERE(ROOT::Experimental::ELogLevel::kDebug, GROUP) TLogEntry & SetLine(int line)
basic_string_view< char > string_view
Namespace for new ROOT classes and functions.
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.
TLogEntry & SetFunction(const std::string &func)
Debug information; only useful for developers.
ELogLevel
Kinds of diagnostics.