Classes

class  Logging
 Base Class for all Logging classes. More...
 
class  LogSender
 Wrapper for the Log IceStorm topic with convenience methods for logging. More...
 

Macros

#define ARMARX_DEBUG   _ARMARX_LOG_INTERNAL_(::armarx::MessageTypeT::DEBUG)
 
#define ARMARX_DEBUG_S   _ARMARX_LOG_INTERNAL_S(::armarx::MessageTypeT::DEBUG)
 
#define ARMARX_ERROR   _ARMARX_LOG_INTERNAL_(::armarx::MessageTypeT::ERROR)
 
#define ARMARX_ERROR_S   _ARMARX_LOG_INTERNAL_S(::armarx::MessageTypeT::ERROR)
 
#define ARMARX_FATAL   _ARMARX_LOG_INTERNAL_(::armarx::MessageTypeT::FATAL)
 
#define ARMARX_FATAL_S   _ARMARX_LOG_INTERNAL_S(::armarx::MessageTypeT::FATAL)
 
#define ARMARX_IMPORTANT   _ARMARX_LOG_INTERNAL_(::armarx::MessageTypeT::IMPORTANT)
 
#define ARMARX_IMPORTANT_S   _ARMARX_LOG_INTERNAL_S(::armarx::MessageTypeT::IMPORTANT)
 
#define ARMARX_INFO   _ARMARX_LOG_INTERNAL_(::armarx::MessageTypeT::INFO)
 
#define ARMARX_INFO_S   _ARMARX_LOG_INTERNAL_S(::armarx::MessageTypeT::INFO)
 
#define ARMARX_LOG   (*ARMARX_LOG_S.setLocalMinimumLoggingLevel(this->Logging::minimumLoggingLevel)) << this->::armarx::Logging::tag
 
#define ARMARX_LOG_S   (*(::armarx::LogSender::createLogSender()->setFile(__FILE__)->setLine(__LINE__)->setFunction(ARMARX_FUNCTION)))
 
#define ARMARX_VERBOSE   _ARMARX_LOG_INTERNAL_(::armarx::MessageTypeT::VERBOSE)
 
#define ARMARX_VERBOSE_S   _ARMARX_LOG_INTERNAL_S(::armarx::MessageTypeT::VERBOSE)
 
#define ARMARX_WARNING   _ARMARX_LOG_INTERNAL_(::armarx::MessageTypeT::WARN)
 
#define ARMARX_WARNING_S   _ARMARX_LOG_INTERNAL_S(::armarx::MessageTypeT::WARN)
 

Detailed Description

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:

How to use the ArmarX logging facilities

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:

ARMARX_INFO << "cycle time dropped below " << 1 << " fps in Capturer";

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.

Note
To log inside a static function of a class inheriting from Logging, you have to use the logging macros ending on _S, e.g. ARMARX_INFO_S.
If the current minimum log-level is below the used log level, the output string calculation is completly skipped. This means no code with effect on any variable should be put into the logging-code-line. This also means it is performance-wise safe to have a lot debug messages in the code.

The main features in detail:

Macro Definition Documentation

◆ ARMARX_DEBUG

#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

Definition at line 177 of file Logging.h.

◆ ARMARX_DEBUG_S

#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

Definition at line 198 of file Logging.h.

◆ ARMARX_ERROR

#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

Definition at line 189 of file Logging.h.

◆ ARMARX_ERROR_S

#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

Definition at line 209 of file Logging.h.

◆ ARMARX_FATAL

#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

Definition at line 192 of file Logging.h.

◆ ARMARX_FATAL_S

#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

Definition at line 212 of file Logging.h.

◆ ARMARX_IMPORTANT

#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)

Definition at line 183 of file Logging.h.

◆ ARMARX_IMPORTANT_S

#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)

Definition at line 203 of file Logging.h.

◆ ARMARX_INFO

#include <ArmarXCore/core/logging/Logging.h>

The normal logging level

Definition at line 174 of file Logging.h.

◆ ARMARX_INFO_S

#define ARMARX_INFO_S   _ARMARX_LOG_INTERNAL_S(::armarx::MessageTypeT::INFO)

#include <ArmarXCore/core/logging/Logging.h>

Definition at line 195 of file Logging.h.

◆ ARMARX_LOG

#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.

Note
This is deprecated. Use the macros with attached logging level instead like ARMARX_INFO.

example:

ARMARX_LOG << eWARN << "cycle time dropped below " << 1 << "fps in " << "Capturer" << endl;

Definition at line 163 of file Logging.h.

◆ ARMARX_LOG_S

#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:

ARMARX_LOG_S << eWARN << "cycle time dropped below " << 1 << "fps in " << "Capturer" << endl;

Definition at line 145 of file Logging.h.

◆ ARMARX_VERBOSE

#define ARMARX_VERBOSE   _ARMARX_LOG_INTERNAL_(::armarx::MessageTypeT::VERBOSE)

#include <ArmarXCore/core/logging/Logging.h>

The logging level for verbose information

Definition at line 180 of file Logging.h.

◆ ARMARX_VERBOSE_S

#define ARMARX_VERBOSE_S   _ARMARX_LOG_INTERNAL_S(::armarx::MessageTypeT::VERBOSE)

#include <ArmarXCore/core/logging/Logging.h>

Definition at line 200 of file Logging.h.

◆ ARMARX_WARNING

#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

Definition at line 186 of file Logging.h.

◆ ARMARX_WARNING_S

#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

Definition at line 206 of file Logging.h.

ARMARX_LOG_S
#define ARMARX_LOG_S
Definition: Logging.h:145
ARMARX_LOG
#define ARMARX_LOG
Definition: Logging.h:163
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174