ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Logging Macros

Detailed Description

Helper macros for logging with Acts::Logger.

When a logger accessible via the logger() method, see Logging Patterns, use these macros to perform the actual logging:

ACTS_VERBOSE("Detailed trace information");
ACTS_DEBUG("Debug info: " << variable);
ACTS_INFO("Operation completed");
ACTS_WARNING("Potential issue detected");
ACTS_ERROR("Operation failed: " << errorMsg);
ACTS_FATAL("Critical failure");

The macros support stream-style formatting with << operators.

Macros

#define ACTS_DEBUG(x)
 macro for debug debug output
#define ACTS_ERROR(x)
 macro for error debug output
#define ACTS_FATAL(x)
 macro for fatal debug output
#define ACTS_INFO(x)
 macro for info debug output
#define ACTS_LOCAL_LOGGER(log_object)
 Macro to use a local Acts::Logger object.
#define ACTS_LOG(level, x)
#define ACTS_VERBOSE(x)
 macro for verbose debug output
#define ACTS_WARNING(x)
 macro for warning debug output

Macro Definition Documentation

◆ ACTS_DEBUG

#define ACTS_DEBUG ( x)
Value:
#define ACTS_LOG(level, x)
Definition Logger.hpp:67
@ DEBUG
Debug information during development.
Definition Logger.hpp:158

macro for debug debug output

Parameters
xdebug message
Precondition
logger() must be a valid expression in the scope where this macro is used and it must return a Acts::Logger object.

The debug message is printed if the current Acts::Logging::Level <= Acts::Logging::DEBUG.

◆ ACTS_ERROR

#define ACTS_ERROR ( x)
Value:
@ ERROR
Error conditions which require follow-up.
Definition Logger.hpp:161

macro for error debug output

Parameters
xdebug message
Precondition
logger() must be a valid expression in the scope where this macro is used and it must return a Acts::Logger object.

The debug message is printed if the current Acts::Logging::Level <= Acts::Logging::ERROR.

◆ ACTS_FATAL

#define ACTS_FATAL ( x)
Value:
@ FATAL
Unrecoverable error conditions.
Definition Logger.hpp:162

macro for fatal debug output

Parameters
xdebug message
Precondition
logger() must be a valid expression in the scope where this macro is used and it must return a Acts::Logger object.

The debug message is printed if the current Acts::Logging::Level <= Acts::Logging::FATAL.

◆ ACTS_INFO

#define ACTS_INFO ( x)
Value:
@ INFO
General information messages.
Definition Logger.hpp:159

macro for info debug output

Parameters
xdebug message
Precondition
logger() must be a valid expression in the scope where this macro is used and it must return a Acts::Logger object.

The debug message is printed if the current Acts::Logging::Level <= Acts::Logging::INFO.

◆ ACTS_LOCAL_LOGGER

#define ACTS_LOCAL_LOGGER ( log_object)
Value:
struct __local_acts_logger { \
explicit __local_acts_logger(std::unique_ptr<const ::Acts::Logger> logger) \
: m_logger(std::move(logger)) {} \
\
const ::Acts::Logger& operator()() const { \
return *m_logger; \
} \
\
std::unique_ptr<const ::Acts::Logger> m_logger; \
}; \
__local_acts_logger logger(log_object);

Macro to use a local Acts::Logger object.

Parameters
log_objectlogger instance of type
Precondition
In the current scope, the symbol logger is not yet defined.
Postcondition
The ownership of the given log_object is transferred and log_object should not be used directly any more.

This macro allows to use a locally defined logging object with the ACTS_* logging macros. The envisaged usage is the following:

void myFunction() {
auto myLogger = Acts::getDefaultLogger("Production", Acts::Logging::WARNING);
ACTS_LOCAL_LOGGER(std::move(myLogger));
ACTS_VERBOSE("hello world!");
}

◆ ACTS_LOG

#define ACTS_LOG ( level,
x )
Value:
do { \
if (logger().doPrint(level)) { \
std::ostringstream os; \
os << x; \
logger().log(level, os.str()); \
} \
} while (0)

◆ ACTS_VERBOSE

#define ACTS_VERBOSE ( x)
Value:
@ VERBOSE
Detailed diagnostic trace information.
Definition Logger.hpp:157

macro for verbose debug output

Parameters
xdebug message
Precondition
logger() must be a valid expression in the scope where this macro is used and it must return a Acts::Logger object.

The debug message is printed if the current Acts::Logging::Level <= Acts::Logging::VERBOSE.

◆ ACTS_WARNING

#define ACTS_WARNING ( x)
Value:
@ WARNING
Non-critical error conditions.
Definition Logger.hpp:160

macro for warning debug output

Parameters
xdebug message
Precondition
logger() must be a valid expression in the scope where this macro is used and it must return a Acts::Logger object.

The debug message is printed if the current Acts::Logging::Level <= Acts::Logging::WARNING.