|
Celeritas 0.7.0-dev.313+develop.1857205b
|
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. | |
| ScopedGeantLogger & | operator= (ScopedGeantLogger const &)=delete |
| ScopedGeantLogger (ScopedGeantLogger &&)=delete | |
| ScopedGeantLogger & | operator= (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. | |
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.
celeritas::world_logger to avoid printing duplicate messages per thread/process.celeritas::self_logger so that only warning/error messages are printed for event/track-specific details.
|
inlineexplicit |
Install the Celeritas Geant4 logger.
A global flag allows multiple logger adapters to be nested without consequence.