|
Classes | |
class | Logging |
Base Class for all Logging classes. More... | |
class | LogSender |
Wrapper for the Log IceStorm topic with convenience methods for logging. More... | |
Every output in ArmarX should be done with the built-in logging features. The ArmarX logging facilities are available anytime and anywhere in the code and should be used instead of std::cout or printf().
ArmarX Logging provides the following main features:
For logging there are a few macros available (e.g. "ARMARX_INFO"). They all begin with "ARMARX_". Followed by the log level (e.g. "ARMARX_INFO").
An example looks like this:
After the c++-line has ended (i.e. after the semi-colon), the data is written as one entry into the log.
To be able use the logging facilities, one has to include the file <ArmarXCore/core/logging/Logging.h>.
If you want to use all logging features, you need to let your class inherit from armarx::Logging. Then features like tagging and spam-deactivation are available.
The main features in detail:
#define ARMARX_DEBUG _ARMARX_LOG_INTERNAL_(::armarx::MessageTypeT::DEBUG) |
#include <ArmarXCore/core/logging/Logging.h>
The logging level for output that is only interesting while debugging
#define ARMARX_DEBUG_S _ARMARX_LOG_INTERNAL_S(::armarx::MessageTypeT::DEBUG) |
#include <ArmarXCore/core/logging/Logging.h>
The logging level for output that is only interesting while debugging
#define ARMARX_ERROR _ARMARX_LOG_INTERNAL_(::armarx::MessageTypeT::ERROR) |
#include <ArmarXCore/core/logging/Logging.h>
The logging level for unexpected behaviour, that must be fixed
#define ARMARX_ERROR_S _ARMARX_LOG_INTERNAL_S(::armarx::MessageTypeT::ERROR) |
#include <ArmarXCore/core/logging/Logging.h>
The logging level for unexpected behaviour, that must be fixed
#define ARMARX_FATAL _ARMARX_LOG_INTERNAL_(::armarx::MessageTypeT::FATAL) |
#include <ArmarXCore/core/logging/Logging.h>
The logging level for unexpected behaviour, that will lead to a seriously malfunctioning program and probably to program exit
#define ARMARX_FATAL_S _ARMARX_LOG_INTERNAL_S(::armarx::MessageTypeT::FATAL) |
#include <ArmarXCore/core/logging/Logging.h>
The logging level for unexpected behaviour, that will lead to a seriously malfunctioning program and probably to program exit
#define ARMARX_IMPORTANT _ARMARX_LOG_INTERNAL_(::armarx::MessageTypeT::IMPORTANT) |
#include <ArmarXCore/core/logging/Logging.h>
The logging level for always important information, but expected behaviour (in contrast to ARMARX_WARNING)
#define ARMARX_IMPORTANT_S _ARMARX_LOG_INTERNAL_S(::armarx::MessageTypeT::IMPORTANT) |
#include <ArmarXCore/core/logging/Logging.h>
The logging level for always important information, but expected behaviour (in contrast to ARMARX_WARNING)
#define ARMARX_INFO _ARMARX_LOG_INTERNAL_(::armarx::MessageTypeT::INFO) |
#include <ArmarXCore/core/logging/Logging.h>
The normal logging level
#define ARMARX_INFO_S _ARMARX_LOG_INTERNAL_S(::armarx::MessageTypeT::INFO) |
#include <ArmarXCore/core/logging/Logging.h>
#define ARMARX_LOG (*ARMARX_LOG_S.setLocalMinimumLoggingLevel(this->Logging::minimumLoggingLevel)) << this->::armarx::Logging::tag |
#include <ArmarXCore/core/logging/Logging.h>
This macro retrieves the armarx::LogSender instance of this class which can then be used to log data using the << operator . This macro can be used by classes that inherit from Logging.
example:
#define ARMARX_LOG_S (*(::armarx::LogSender::createLogSender()->setFile(__FILE__)->setLine(__LINE__)->setFunction(ARMARX_FUNCTION))) |
#include <ArmarXCore/core/logging/Logging.h>
This macro creates a new temporary instance which can then be used to log data using the << operator. This macro is dedicated to the special case logging in a static function of a class that inherits Logging. For all other cases the non static version should be used (without _S). S stands for static.
example:
#define ARMARX_VERBOSE _ARMARX_LOG_INTERNAL_(::armarx::MessageTypeT::VERBOSE) |
#include <ArmarXCore/core/logging/Logging.h>
The logging level for verbose information
#define ARMARX_VERBOSE_S _ARMARX_LOG_INTERNAL_S(::armarx::MessageTypeT::VERBOSE) |
#include <ArmarXCore/core/logging/Logging.h>
#define ARMARX_WARNING _ARMARX_LOG_INTERNAL_(::armarx::MessageTypeT::WARN) |
#include <ArmarXCore/core/logging/Logging.h>
The logging level for unexpected behaviour, but not a serious problem
#define ARMARX_WARNING_S _ARMARX_LOG_INTERNAL_S(::armarx::MessageTypeT::WARN) |
#include <ArmarXCore/core/logging/Logging.h>
The logging level for unexpected behaviour, but not a serious problem