GGS(GenericGEANT4Simulation)Software
2.7.0
|
#include <iomanip>
#include <iostream>
Go to the source code of this file.
Macros | |
#define | COUT(level) |
Smart log macro. It writes on stdout only if the specified verbosity level is lesser than the maximum one (GGSSmartLog::verboseLevel). More... | |
#define | CCOUT(level) |
Smart log utility which prints no header at the beginning of the line. More... | |
#define | ENDL 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 () |
Unutes the console output. More... | |
Some utilities for logs with support for different verbosity levels.
Definition in file GGSSmartLog.h.
#define CCOUT | ( | 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 COUT on subsequent lines without repeating the header at each line. For example:
static const std::string routineName("dummyFunction"); COUT(ERROR) << "Error reasons:" << ENDL; CCOUT(ERROR) << "- Reason 1" << ENDL; CCOUT(ERROR) << "- Reason 2" << ENDL;
will print:
[dummyFunction] ERROR Error reasons:
Definition at line 100 of file GGSSmartLog.h.
#define COUT | ( | level | ) |
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") COUT(ERROR) << "This is an error message." << ENDL;}
will print:
[dummyFunction] ERROR This is an error message.
only if GGSSmartLog::verboseLevel has been set to ERROR or higher.
Definition at line 76 of file GGSSmartLog.h.
#define ENDL std::endl |
Alias for std::endl.
Definition at line 105 of file GGSSmartLog.h.