Logo ROOT  
Reference Guide
ROOT::Experimental::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 136 of file RLogger.hxx.

Public Member Functions

 RLogManager (std::unique_ptr< RLogHandler > lh)
 Initialize taking a RLogHandler. More...
 
bool Emit (const RLogEntry &entry) override
 Emit a log entry. More...
 
void PushBack (std::unique_ptr< RLogHandler > handler)
 Add a RLogHandler in the back - to be called after all others. More...
 
void PushFront (std::unique_ptr< RLogHandler > handler)
 Add a RLogHandler in the front - to be called before all others. More...
 
std::unique_ptr< RLogHandlerRemove (RLogHandler *handler)
 Remove and return the given log handler. Returns nullptr if not found. More...
 
- Public Member Functions inherited from ROOT::Experimental::RLogChannel
 RLogChannel ()=default
 Construct an anonymous channel. More...
 
 RLogChannel (const std::string &name)
 Construct a log channel given its name, which is part of the diagnostics. More...
 
 RLogChannel (ELogLevel verbosity)
 Construct an anonymous channel with a default verbosity. More...
 
ELogLevel GetEffectiveVerbosity (const RLogManager &mgr) const
 
const std::string & GetName () const
 
ELogLevel GetVerbosity () const
 
ELogLevel SetVerbosity (ELogLevel verbosity)
 
- Public Member Functions inherited from ROOT::Experimental::RLogDiagCount
long long GetNumErrors () const
 Returns the current number of errors. More...
 
long long GetNumFatalErrors () const
 Returns the current number of fatal errors. More...
 
long long GetNumWarnings () const
 Number of fatal errors. More...
 
void Increment (ELogLevel severity)
 Increase warning or error count. More...
 
- Public Member Functions inherited from ROOT::Experimental::RLogHandler
virtual ~RLogHandler ()
 
virtual bool Emit (const RLogEntry &entry)=0
 Emit a log entry. More...
 

Static Public Member Functions

static RLogManagerGet ()
 

Private Attributes

std::list< std::unique_ptr< RLogHandler > > fHandlers
 
std::mutex fMutex
 

Additional Inherited Members

- Protected Attributes inherited from ROOT::Experimental::RLogDiagCount
std::atomic< long longfNumErrors {0ll}
 Number of warnings. More...
 
std::atomic< long longfNumFatalErrors {0ll}
 Number of errors. More...
 
std::atomic< long longfNumWarnings {0ll}
 

#include <ROOT/RLogger.hxx>

Inheritance diagram for ROOT::Experimental::RLogManager:
[legend]

Constructor & Destructor Documentation

◆ RLogManager()

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

Initialize taking a RLogHandler.

Definition at line 142 of file RLogger.hxx.

Member Function Documentation

◆ Emit()

bool 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::Experimental::RLogHandler.

Definition at line 82 of file RLogger.cxx.

◆ Get()

RLogManager & RLogManager::Get ( )
static

Definition at line 62 of file RLogger.cxx.

◆ PushBack()

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

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

Definition at line 153 of file RLogger.hxx.

◆ PushFront()

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

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

Definition at line 150 of file RLogger.hxx.

◆ Remove()

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

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

Definition at line 68 of file RLogger.cxx.

Member Data Documentation

◆ fHandlers

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

Definition at line 138 of file RLogger.hxx.

◆ fMutex

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

Definition at line 137 of file RLogger.hxx.


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