Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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.
 
bool Emit (const RLogEntry &entry) override
 Emit a log entry.
 
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.
 
- Public Member Functions inherited from ROOT::Experimental::RLogChannel
 RLogChannel ()=default
 Construct an anonymous channel.
 
 RLogChannel (const std::string &name)
 Construct a log channel given its name, which is part of the diagnostics.
 
 RLogChannel (ELogLevel verbosity)
 Construct an anonymous channel with a default verbosity.
 
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.
 
long long GetNumFatalErrors () const
 Returns the current number of fatal errors.
 
long long GetNumWarnings () const
 Number of fatal errors.
 
void Increment (ELogLevel severity)
 Increase warning or error count.
 
- Public Member Functions inherited from ROOT::Experimental::RLogHandler
virtual ~RLogHandler ()
 

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.
 
std::atomic< long longfNumFatalErrors {0ll}
 Number of errors.
 
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.

  • core/foundation/inc/ROOT/RLogger.hxx
  • core/foundation/src/RLogger.cxx