GGS(GenericGEANT4Simulation)Software
2.99.0
|
#include <iomanip>
#include <iostream>
Go to the source code of this file.
Macros | |
#define | GGSCOUT_BACKEND std::cout |
Smart log macro. It writes on stdout only if the specified verbosity level is lesser than the maximum one (GGSSmartLog::verboseLevel). More... | |
#define | GGSCOUT(level) |
#define | GGSCCOUT(level) |
Smart log utility which prints no header at the beginning of the line. More... | |
#define | GGSENDL std::endl |
Enumerations | |
enum | { SILENT, ERROR, WARNING, INFO, DEBUG, DEEPDEB } |
Functions | |
const std::string & | GGSSmartLog::Format (const std::string &str, unsigned int maxLength) |
Format a string so that its length is less or equal to maxLength. More... | |
void | GGSSmartLog::MuteOutput () |
Mutes the console output. More... | |
void | GGSSmartLog::UnmuteOutput () |
Unmutes the console output. More... | |
Some utilities for logs with support for different verbosity levels.
Definition in file GGSSmartLog.h.
#define GGSCCOUT | ( | level | ) |
Smart log utility which prints no header at the beginning of the line.
This macro is useful to continue the output of the standard GGSCOUT on subsequent lines without repeating the header at each line. For example:
static const std::string routineName("dummyFunction"); GGSCOUT(ERROR) << "Error reasons:" << GGSENDL; GGSCCOUT(ERROR) << "- Reason 1" << GGSENDL; GGSCCOUT(ERROR) << "- Reason 2" << GGSENDL;
will print:
[dummyFunction] ERROR Error reasons:
Definition at line 126 of file GGSSmartLog.h.
#define GGSCOUT | ( | level | ) |
Definition at line 102 of file GGSSmartLog.h.
#define GGSCOUT_BACKEND std::cout |
Smart log macro. It writes on stdout only if the specified verbosity level is lesser than the maximum one (GGSSmartLog::verboseLevel).
It requires to define a routineName string variable inside every context from which it is called. For example:
void dummyFunction{ static const std::string routineName("dummyFunction") GGSCOUT(ERROR) << "This is an error message." << GGSENDL;}
will print:
[dummyFunction] ERROR This is an error message.
only if GGSSmartLog::verboseLevel has been set to ERROR or higher.
Definition at line 100 of file GGSSmartLog.h.
#define GGSENDL std::endl |
Alias for std::endl.
Definition at line 131 of file GGSSmartLog.h.