Classes | Namespaces | Macros
EDepSimLog.hh File Reference
#include <iostream>
#include <iomanip>
#include <string>
#include <map>

Go to the source code of this file.

Classes

class  EDepSim::LogManager
 

Namespaces

 EDepSim
 Construct a module from components.
 

Macros

#define _EDEPSIM_OUTPUT_ERROR(trace, outStream)
 
#define EDEPSIM_ERROR_OUTPUT   true
 
#define EDepSimError(outStream)
 
#define EDepSimNamedError(trace, outStream)
 
#define EDepSimSevere(outStream)
 
#define EDepSimNamedSevere(trace, outStream)
 
#define EDepSimWarn(outStream)
 
#define EDepSimNamedWarn(trace, outStream)
 
#define EDepSimDebug(outStream)
 
#define EDepSimNamedDebug(trace, outStream)
 
#define EDepSimTrace(outStream)
 
#define EDepSimNamedTrace(trace, outStream)
 
#define _EDEPSIM_OUTPUT_LOG(trace, outStream)
 
#define EDEPSIM_LOG_OUTPUT   true
 
#define EDepSimLog(outStream)
 
#define EDepSimNamedLog(trace, outStream)
 
#define EDepSimInfo(outStream)
 
#define EDepSimNamedInfo(trace, outStream)
 
#define EDepSimVerbose(outStream)
 
#define EDepSimNamedVerbose(trace, outStream)
 

Macro Definition Documentation

#define _EDEPSIM_OUTPUT_ERROR (   trace,
  outStream 
)
Value:
do { \
std::ios::fmtflags save \
EDepSim::LogManager::GetDebugStream() << trace << __FILE__ \
<< ":" << __LINE__ << ": " \
<< outStream \
<< std::setw(0) \
<< std::setfill(' ') \
<< std::endl; \
EDepSim::LogManager::GetDebugStream().flags(save); \
} while (0)
Q_EXPORT QTSManip setprecision(int p)
Definition: qtextstream.h:343
M::value_type trace(const M &m)
def save(obj, fname)
Definition: root.py:19
Q_EXPORT QTSManip setw(int w)
Definition: qtextstream.h:331
static std::ostream & GetDebugStream()
Return the stream associated with the error file.
int flags() const
Definition: qtextstream.h:232
Q_EXPORT QTSManip setfill(int f)
Definition: qtextstream.h:337
QTextStream & endl(QTextStream &s)

INTERNAL: A macro to handle the output of an error message. This is used by the user visible macros.

Definition at line 473 of file EDepSimLog.hh.

#define _EDEPSIM_OUTPUT_LOG (   trace,
  outStream 
)
Value:
do { \
std::ios::fmtflags save \
EDepSim::LogManager::GetLogStream() \
<< trace \
<< outStream \
<< std::setw(0) \
<< std::setfill(' ') \
<< std::endl; \
EDepSim::LogManager::GetLogStream().flags(save); \
} while (0)
static std::ostream & GetLogStream()
Return the stream associated with the log file.
static std::string MakeIndent()
[Internal method] Make an indentation for a log message.
Q_EXPORT QTSManip setprecision(int p)
Definition: qtextstream.h:343
M::value_type trace(const M &m)
def save(obj, fname)
Definition: root.py:19
Q_EXPORT QTSManip setw(int w)
Definition: qtextstream.h:331
int flags() const
Definition: qtextstream.h:232
Q_EXPORT QTSManip setfill(int f)
Definition: qtextstream.h:337
QTextStream & endl(QTextStream &s)

INTERNAL: A macro to handle the output of a log message. This is used by the user visible macros.

Definition at line 688 of file EDepSimLog.hh.

#define EDEPSIM_ERROR_OUTPUT   true

Set this to false if the error output code should not be included in the executable. This can be redefined in user code and depends on the optimizers to not emit code a constant contitionals (that's the usual behavior for a compiler).

Definition at line 493 of file EDepSimLog.hh.

#define EDEPSIM_LOG_OUTPUT   true

Set this to false if the logging output code should not be included in the executable. This can be redefined in user code and depends on the optimizers to not emit code a constant contitionals (that's the usual behavior for a compiler).

Definition at line 709 of file EDepSimLog.hh.

#define EDepSimDebug (   outStream)
Value:
do { \
_EDEPSIM_OUTPUT_ERROR("DEBUG: ",outStream); \
} \
} while (0)
static ErrorPriority GetDebugLevel()
Get the current debugging level;.
Definition: EDepSimLog.hh:417
#define EDEPSIM_ERROR_OUTPUT
Definition: EDepSimLog.hh:493

Print an debugging message that appears at the EDepSim::LogManager::DebugLevel of error output. This macro should be used to print output needed during the debugging. The EDepSimTrace() macro should be used during debugging to provide traces of the code execution. This macro takes one Streamish Argument providing the error message.

Definition at line 614 of file EDepSimLog.hh.

#define EDepSimError (   outStream)
Value:
do { \
_EDEPSIM_OUTPUT_ERROR("ERROR: ",outStream); \
} \
} while (0)
#define EDEPSIM_ERROR_OUTPUT
Definition: EDepSimLog.hh:493

Print an error message that cannot be suppressed by changing the error output level. The use of EDepSimError() can generated a lot of chatter, so it should be reserved to cases where you expect the program to crash (for example, the next line is a call to abort()), and prefer the EDepSimSevere macro. The EDepSimError macro takes one Streamish Argument providing the error message.

Definition at line 503 of file EDepSimLog.hh.

#define EDepSimInfo (   outStream)
Value:
do { \
_EDEPSIM_OUTPUT_LOG("%% ",outStream); \
} \
} while (0)
#define EDEPSIM_LOG_OUTPUT
Definition: EDepSimLog.hh:709
static LogPriority GetLogLevel()
Get the current logging level;.
Definition: EDepSimLog.hh:432

Print a message to the log that appears at the EDepSim::LogManager::InfoLevel of output. This macro takes one Streamish Argument providing the log message.

Definition at line 752 of file EDepSimLog.hh.

#define EDepSimLog (   outStream)
Value:
do { \
_EDEPSIM_OUTPUT_LOG("% ",outStream); \
} \
} while (0)
#define EDEPSIM_LOG_OUTPUT
Definition: EDepSimLog.hh:709
static LogPriority GetLogLevel()
Get the current logging level;.
Definition: EDepSimLog.hh:432

Print a message to the log that appears at the EDepSim::LogManager::LogLevel of output. This should be reserved for log messages that should appear during production. This macro takes one Streamish Argument providing the log message.

Definition at line 717 of file EDepSimLog.hh.

#define EDepSimNamedDebug (   trace,
  outStream 
)
Value:
do { \
_EDEPSIM_OUTPUT_ERROR("DEBUG[" trace "]: ", outStream); \
} \
} while (0)
static ErrorPriority GetDebugLevel()
Get the current debugging level;.
Definition: EDepSimLog.hh:417
M::value_type trace(const M &m)
#define EDEPSIM_ERROR_OUTPUT
Definition: EDepSimLog.hh:493

Print an debugging message that appears at the EDepSim::LogManager::DebugLevel of error output. This macro should be used to print output needed during the debugging. The EDepSimTrace() macro should be used during debugging to provide traces of the code execution. This macro takes two arguments: The first argument must be a Trace Name (a string). The second argument is a Streamish Argument providing the error message.

Definition at line 634 of file EDepSimLog.hh.

#define EDepSimNamedError (   trace,
  outStream 
)
Value:
do { \
_EDEPSIM_OUTPUT_ERROR("ERROR[" trace "]: ", outStream); \
} \
} while (0)
static ErrorPriority GetDebugLevel()
Get the current debugging level;.
Definition: EDepSimLog.hh:417
M::value_type trace(const M &m)
#define EDEPSIM_ERROR_OUTPUT
Definition: EDepSimLog.hh:493

Print an named error message that appears at the default error output level. The use of EDepSimNamedError() should generally be reserved to cases where you expect the program to crash, or for which data is going to be lost. This macro takes two arguments: The first argument must be a Trace Name (a string). The second argument is a Streamish Argument providing the error message.

Definition at line 520 of file EDepSimLog.hh.

#define EDepSimNamedInfo (   trace,
  outStream 
)
Value:
do { \
_EDEPSIM_OUTPUT_LOG("%% [" trace "] ",outStream); \
} \
} while (0)
#define EDEPSIM_LOG_OUTPUT
Definition: EDepSimLog.hh:709
M::value_type trace(const M &m)
static LogPriority GetLogLevel()
Get the current logging level;.
Definition: EDepSimLog.hh:432

Print a message to the log that appears at the EDepSim::LogManager::InfoLevel of output. This macro takes two arguments: The first argument must a Trace Name (a string). The second argument is a Streamish Argument providing the log message.

Definition at line 770 of file EDepSimLog.hh.

#define EDepSimNamedLog (   trace,
  outStream 
)
Value:
do { \
_EDEPSIM_OUTPUT_LOG("% [" trace "] ",outStream); \
} \
} while (0)
#define EDEPSIM_LOG_OUTPUT
Definition: EDepSimLog.hh:709
M::value_type trace(const M &m)
static LogPriority GetLogLevel()
Get the current logging level;.
Definition: EDepSimLog.hh:432

Print a message to the log that appears at the EDepSim::LogManager::LogLevel of output. This macro takes two arguments: The first argument must be a Trace Name (a string). The second argument is a Streamish Argument providing the log message.

Definition at line 735 of file EDepSimLog.hh.

#define EDepSimNamedSevere (   trace,
  outStream 
)
Value:
do { \
_EDEPSIM_OUTPUT_ERROR("SEVERE[" trace "]: ", outStream); \
} \
} while (0)
static ErrorPriority GetDebugLevel()
Get the current debugging level;.
Definition: EDepSimLog.hh:417
M::value_type trace(const M &m)
#define EDEPSIM_ERROR_OUTPUT
Definition: EDepSimLog.hh:493

Print an error message that appears at the EDepSim::LogManager::SevereLevel of error output. This macro should be reserved for error conditions where event data is going to be lost, or where the event might contain incorrect information. This macro takes two arguments: The first argument must be a Trace Name (a string). The second argument is a Streamish Argument providing the error message.

Definition at line 558 of file EDepSimLog.hh.

#define EDepSimNamedTrace (   trace,
  outStream 
)
Value:
do { \
_EDEPSIM_OUTPUT_ERROR("TRACE[" trace "]: ", outStream); \
} \
} while (0)
static ErrorPriority GetDebugLevel()
Get the current debugging level;.
Definition: EDepSimLog.hh:417
M::value_type trace(const M &m)
#define EDEPSIM_ERROR_OUTPUT
Definition: EDepSimLog.hh:493

Print an debugging message that appears at the EDepSim::LogManager::TraceLevel of error output. This macro should be used to print short messages that trace the execution of code being debugged. This macro takes two arguments: The first argument must be a Trace Name (a string). The second argument is a Streamish Argument providing the error message.

Definition at line 672 of file EDepSimLog.hh.

#define EDepSimNamedVerbose (   trace,
  outStream 
)
Value:
do { \
_EDEPSIM_OUTPUT_LOG("%%% [" trace "] ",outStream); \
} \
} while (0)
#define EDEPSIM_LOG_OUTPUT
Definition: EDepSimLog.hh:709
M::value_type trace(const M &m)
static LogPriority GetLogLevel()
Get the current logging level;.
Definition: EDepSimLog.hh:432

Print a message to the log that appears at the EDepSim::LogManager::VerboseLevel of output. This macro takes two arguments: The first argument must be a Trace Name (a string). The second argument is a Streamish Argument providing the log message.

Definition at line 805 of file EDepSimLog.hh.

#define EDepSimNamedWarn (   trace,
  outStream 
)
Value:
do { \
_EDEPSIM_OUTPUT_ERROR("WARNING[" trace "]: ", outStream); \
} \
} while (0)
static ErrorPriority GetDebugLevel()
Get the current debugging level;.
Definition: EDepSimLog.hh:417
M::value_type trace(const M &m)
#define EDEPSIM_ERROR_OUTPUT
Definition: EDepSimLog.hh:493

Print an error message that appears at the EDepSim::LogManager::WarnLevel of error output. This macro should be used when a correctable, but unexpected, problem is found with an event. This macro takes two arguments: The first argument must be a Trace Name (a string). The second argument is a Streamish Argument providing the error message.

Definition at line 594 of file EDepSimLog.hh.

#define EDepSimSevere (   outStream)
Value:
do { \
_EDEPSIM_OUTPUT_ERROR("SEVERE: ",outStream); \
} \
} while (0)
static ErrorPriority GetDebugLevel()
Get the current debugging level;.
Definition: EDepSimLog.hh:417
#define EDEPSIM_ERROR_OUTPUT
Definition: EDepSimLog.hh:493

Print an error message that appears at the EDepSim::LogManager::SevereLevel of error output. This macro should be reserved for error conditions where event data is going to be lost, or where the event might contain incorrect information. This macro takes one Streamish Argument providing the error message.

Definition at line 539 of file EDepSimLog.hh.

#define EDepSimTrace (   outStream)
Value:
do { \
_EDEPSIM_OUTPUT_ERROR("TRACE:",outStream); \
} \
} while (0)
static ErrorPriority GetDebugLevel()
Get the current debugging level;.
Definition: EDepSimLog.hh:417
#define EDEPSIM_ERROR_OUTPUT
Definition: EDepSimLog.hh:493

Print an debugging message that appears at the EDepSim::LogManager::TraceLevel of error output. This macro should be used to print short messages that trace the execution of code being debugged. This macro takes one Streamish Argument providing the error message.

Definition at line 653 of file EDepSimLog.hh.

#define EDepSimVerbose (   outStream)
Value:
do { \
_EDEPSIM_OUTPUT_LOG("%%% ",outStream); \
} \
} while (0)
#define EDEPSIM_LOG_OUTPUT
Definition: EDepSimLog.hh:709
static LogPriority GetLogLevel()
Get the current logging level;.
Definition: EDepSimLog.hh:432

Print a message to the log that appears at the EDepSim::LogManager::VerboseLevel of output. This macro takes one Streamish Argument providing the log message.

Definition at line 787 of file EDepSimLog.hh.

#define EDepSimWarn (   outStream)
Value:
do { \
_EDEPSIM_OUTPUT_ERROR("WARNING: ",outStream); \
} \
} while (0)
static ErrorPriority GetDebugLevel()
Get the current debugging level;.
Definition: EDepSimLog.hh:417
#define EDEPSIM_ERROR_OUTPUT
Definition: EDepSimLog.hh:493

Print an error message that appears at the EDepSim::LogManager::WarnLevel of error output. This macro should be used when a correctable, but unexpected, problem is found with an event. This macro takes one Streamish Argument providing the error message.

Definition at line 576 of file EDepSimLog.hh.