Celeritas 0.7.0-dev.313+develop.1857205b
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
celeritas::ScopedGeantLogger Class Reference

Redirect Geant4 logging through Celeritas' logger. More...

#include <ScopedGeantLogger.hh>

Classes

class  StreamDestination
 Send Geant4 log messages to Celeritas' world logger. More...
 

Public Member Functions

 ScopedGeantLogger (Logger &)
 Install the Celeritas Geant4 logger.
 
 ScopedGeantLogger ()
 Install the Celeritas Geant4 logger using the world logger.
 
 ~ScopedGeantLogger ()
 Revert to the previous exception handler.
 
 ScopedGeantLogger (ScopedGeantLogger const &)=delete
 Prevent copying and moving for RAII class.
 
ScopedGeantLoggeroperator= (ScopedGeantLogger const &)=delete
 
 ScopedGeantLogger (ScopedGeantLogger &&)=delete
 
ScopedGeantLoggeroperator= (ScopedGeantLogger &&)=delete
 

Static Public Member Functions

static bool enabled ()
 Enable and disable to avoid recursion with accel/Logger.
 
static void enabled (bool)
 Enable and disable to avoid recursion with accel/Logger.
 

Detailed Description

Redirect Geant4 logging through Celeritas' logger.

This parses messages sent to G4cout and G4cerr from Geant4. Based on the message (whether it starts with warning, error, '!!!', '***') it tries to use the appropriate logging level and source context.

Since the Geant4 output streams are thread-local, this class is as well. Multiple geant loggers can be nested in scope, but only the outermost on a given thread will "own" the log destination.

Constructor & Destructor Documentation

◆ ScopedGeantLogger()

celeritas::ScopedGeantLogger::ScopedGeantLogger ( Logger celer_log)
inlineexplicit

Install the Celeritas Geant4 logger.

A global flag allows multiple logger adapters to be nested without consequence.


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