Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
ROOT::RLogManager Class Reference

A RLogHandler that multiplexes diagnostics to different client RLogHandlers and keeps track of the sum of RLogDiagCounts for all channels.

RLogHandler::Get() returns the process's (static) log manager.

Definition at line 132 of file RLogger.hxx.

Public Member Functions

 RLogManager (std::unique_ptr< RLogHandler > lh)
 Initialize taking a RLogHandler.
bool Emit (const RLogEntry &entry) override
 Emit a log entry.
ELogLevel GetEffectiveVerbosity (const RLogManager &mgr) const
const std::string & GetName () const
long long GetNumErrors () const
 Returns the current number of errors.
long long GetNumFatalErrors () const
 Returns the current number of fatal errors.
long long GetNumWarnings () const
 Number of fatal errors.
ELogLevel GetVerbosity () const
void Increment (ELogLevel severity)
 Increase warning or error count.
void PushBack (std::unique_ptr< RLogHandler > handler)
 Add a RLogHandler in the back - to be called after all others.
void PushFront (std::unique_ptr< RLogHandler > handler)
 Add a RLogHandler in the front - to be called before all others.
std::unique_ptr< RLogHandlerRemove (RLogHandler *handler)
 Remove and return the given log handler. Returns nullptr if not found.
ELogLevel SetVerbosity (ELogLevel verbosity)

Static Public Member Functions

static RLogManagerGet ()

Protected Attributes

std::atomic< long long > fNumErrors {0ll}
 Number of warnings.
std::atomic< long long > fNumFatalErrors {0ll}
 Number of errors.
std::atomic< long long > fNumWarnings {0ll}

Private Attributes

std::list< std::unique_ptr< RLogHandler > > fHandlers
std::mutex fMutex
std::string fName
 Name as shown in diagnostics.
ELogLevel fVerbosity = ELogLevel::kUnset
 Verbosity of this channel. By default, use the global verbosity.

#include <ROOT/RLogger.hxx>

Inheritance diagram for ROOT::RLogManager:
ROOT::RLogChannel ROOT::RLogHandler ROOT::RLogDiagCount

Constructor & Destructor Documentation

◆ RLogManager()

ROOT::RLogManager::RLogManager ( std::unique_ptr< RLogHandler > lh)
inline

Initialize taking a RLogHandler.

Definition at line 138 of file RLogger.hxx.

Member Function Documentation

◆ Emit()

bool ROOT::RLogManager::Emit ( const RLogEntry & entry)
overridevirtual

Emit a log entry.

Parameters
entry- the RLogEntry to be emitted.
Returns
false if further emission of this Log should be suppressed.
Note
This function is called concurrently; log emission must be locked if needed. (The default log handler using ROOT's DefaultErrorHandler is locked.)

Implements ROOT::RLogHandler.

Definition at line 79 of file RLogger.cxx.

◆ Get()

ROOT::RLogManager & ROOT::RLogManager::Get ( )
static

Definition at line 59 of file RLogger.cxx.

◆ GetEffectiveVerbosity()

ELogLevel ROOT::RLogChannel::GetEffectiveVerbosity ( const RLogManager & mgr) const
inlineinherited

Definition at line 309 of file RLogger.hxx.

◆ GetName()

const std::string & ROOT::RLogChannel::GetName ( ) const
inlineinherited

Definition at line 122 of file RLogger.hxx.

◆ GetNumErrors()

long long ROOT::RLogDiagCount::GetNumErrors ( ) const
inlineinherited

Returns the current number of errors.

Definition at line 60 of file RLogger.hxx.

◆ GetNumFatalErrors()

long long ROOT::RLogDiagCount::GetNumFatalErrors ( ) const
inlineinherited

Returns the current number of fatal errors.

Definition at line 63 of file RLogger.hxx.

◆ GetNumWarnings()

long long ROOT::RLogDiagCount::GetNumWarnings ( ) const
inlineinherited

Number of fatal errors.

Returns the current number of warnings.

Definition at line 57 of file RLogger.hxx.

◆ GetVerbosity()

ELogLevel ROOT::RLogChannel::GetVerbosity ( ) const
inlineinherited

Definition at line 119 of file RLogger.hxx.

◆ Increment()

void ROOT::RLogDiagCount::Increment ( ELogLevel severity)
inlineinherited

Increase warning or error count.

Definition at line 66 of file RLogger.hxx.

◆ PushBack()

void ROOT::RLogManager::PushBack ( std::unique_ptr< RLogHandler > handler)
inline

Add a RLogHandler in the back - to be called after all others.

Definition at line 149 of file RLogger.hxx.

◆ PushFront()

void ROOT::RLogManager::PushFront ( std::unique_ptr< RLogHandler > handler)
inline

Add a RLogHandler in the front - to be called before all others.

Definition at line 146 of file RLogger.hxx.

◆ Remove()

std::unique_ptr< ROOT::RLogHandler > ROOT::RLogManager::Remove ( RLogHandler * handler)

Remove and return the given log handler. Returns nullptr if not found.

Definition at line 65 of file RLogger.cxx.

◆ SetVerbosity()

ELogLevel ROOT::RLogChannel::SetVerbosity ( ELogLevel verbosity)
inlineinherited

Definition at line 114 of file RLogger.hxx.

Member Data Documentation

◆ fHandlers

std::list<std::unique_ptr<RLogHandler> > ROOT::RLogManager::fHandlers
private

Definition at line 134 of file RLogger.hxx.

◆ fMutex

std::mutex ROOT::RLogManager::fMutex
private

Definition at line 133 of file RLogger.hxx.

◆ fName

std::string ROOT::RLogChannel::fName
privateinherited

Name as shown in diagnostics.

Definition at line 99 of file RLogger.hxx.

◆ fNumErrors

std::atomic<long long> ROOT::RLogDiagCount::fNumErrors {0ll}
protectedinherited

Number of warnings.

Definition at line 52 of file RLogger.hxx.

◆ fNumFatalErrors

std::atomic<long long> ROOT::RLogDiagCount::fNumFatalErrors {0ll}
protectedinherited

Number of errors.

Definition at line 53 of file RLogger.hxx.

◆ fNumWarnings

std::atomic<long long> ROOT::RLogDiagCount::fNumWarnings {0ll}
protectedinherited

Definition at line 51 of file RLogger.hxx.

◆ fVerbosity

ELogLevel ROOT::RLogChannel::fVerbosity = ELogLevel::kUnset
privateinherited

Verbosity of this channel. By default, use the global verbosity.

Definition at line 102 of file RLogger.hxx.


The documentation for this class was generated from the following files: