39 constexpr static std::array<const char *, numLevels>
sTag{
40 {
"{unset-error-level please report}",
"FATAL",
"Error",
"Warning",
"Info",
"Debug"}};
42 std::stringstream
strm;
43 auto channel =
entry.fChannel;
44 if (channel && !channel->GetName().empty())
45 strm <<
'[' << channel->GetName() <<
"] ";
48 if (!
entry.fLocation.fFile.empty())
49 strm <<
" " <<
entry.fLocation.fFile <<
':' <<
entry.fLocation.fLine;
50 if (!
entry.fLocation.fFuncName.empty())
51 strm <<
" in " <<
entry.fLocation.fFuncName;
55 entry.fMessage.c_str());
68 auto iter = std::find_if(fHandlers.begin(), fHandlers.end(), [&](
const std::unique_ptr<RLogHandler> &
handlerPtr) {
69 return handlerPtr.get() == handler;
71 if (iter != fHandlers.end()) {
72 std::unique_ptr<RLogHandler>
ret;
74 fHandlers.erase(iter);
82 auto channel =
entry.fChannel;
84 Increment(
entry.fLevel);
86 channel->Increment(
entry.fLevel);
90 if (channel->GetEffectiveVerbosity(*
this) <
entry.fLevel)
95 std::vector<RLogHandler *> handlers;
98 std::lock_guard<std::mutex> lock(fMutex);
100 handlers.resize(fHandlers.size());
101 std::transform(fHandlers.begin(), fHandlers.end(), handlers.begin(),
102 [](
const std::unique_ptr<RLogHandler> &
handlerUPtr) { return handlerUPtr.get(); });
105 for (
auto &&handler : handlers)
106 if (!handler->Emit(
entry))
static Roo_reg_AGKInteg1D instance
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
ErrorHandlerFunc_t GetErrorHandler()
Returns the current error handler function.
A diagnostic that can be emitted by the RLogManager.
Abstract RLogHandler base class.
A RLogHandler that multiplexes diagnostics to different client RLogHandlers and keeps track of the su...
std::unique_ptr< RLogHandler > Remove(RLogHandler *handler)
Remove and return the given log handler. Returns nullptr if not found.
bool Emit(const RLogEntry &entry) override
Emit a log entry.
static RLogManager & Get()
@ kInfo
Informational messages; used for instance for tracing.
@ kDebug
Debug information; only useful for developers; can have added verbosity up to 255-kDebug.
@ kFatal
An error which causes further processing to be unreliable.
@ kWarning
Warnings about likely unexpected behavior.