Logging.h File Reference
#include <boost/current_function.hpp>
#include <ArmarXCore/core/logging/LogSender.h>
#include <ArmarXCore/core/util/StringHelpers.h>
#include <ArmarXCore/util/CPPUtility/trace.h>
+ Include dependency graph for Logging.h:

Go to the source code of this file.

Classes

class  Logging
 Base Class for all Logging classes. More...
 

Namespaces

namespace  armarx
 This file offers overloads of toIce() and fromIce() functions for STL container types.
 

Macros

#define _ARMARX_LOG_INTERNAL_(level)
 
#define _ARMARX_LOG_INTERNAL_S(level)
 
#define ARMARX_DEBUG   _ARMARX_LOG_INTERNAL_(::armarx::MessageTypeT::DEBUG)
 The logging level for output that is only interesting while debugging.
 
#define ARMARX_DEBUG_S   _ARMARX_LOG_INTERNAL_S(::armarx::MessageTypeT::DEBUG)
 The logging level for output that is only interesting while debugging.
 
#define ARMARX_ERROR   _ARMARX_LOG_INTERNAL_(::armarx::MessageTypeT::ERROR)
 The logging level for unexpected behaviour, that must be fixed.
 
#define ARMARX_ERROR_S   _ARMARX_LOG_INTERNAL_S(::armarx::MessageTypeT::ERROR)
 The logging level for unexpected behaviour, that must be fixed.
 
#define ARMARX_FATAL   _ARMARX_LOG_INTERNAL_(::armarx::MessageTypeT::FATAL)
 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)
 The logging level for unexpected behaviour, that will lead to a seriously malfunctioning program and probably to program exit.
 
#define ARMARX_FUNCTION   BOOST_CURRENT_FUNCTION
 
#define ARMARX_IMPORTANT   _ARMARX_LOG_INTERNAL_(::armarx::MessageTypeT::IMPORTANT)
 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)
 The logging level for always important information, but expected behaviour (in contrast to ARMARX_WARNING)
 
#define ARMARX_INFO   _ARMARX_LOG_INTERNAL_(::armarx::MessageTypeT::INFO)
 The normal logging level.
 
#define ARMARX_INFO_S   _ARMARX_LOG_INTERNAL_S(::armarx::MessageTypeT::INFO)
 
#define ARMARX_LOG
 
#define ARMARX_LOG_S
 This macro creates a new temporary instance which can then be used to log data using the << operator.
 
#define ARMARX_STREAM_PRINTER   ::armarx::detail::StreamPrinterTag::tag* [&](std::ostream & out)
 use this macro to write output code that is executed when printed and thus not executed if the debug level prevents printing.
 
#define ARMARX_VERBOSE   _ARMARX_LOG_INTERNAL_(::armarx::MessageTypeT::VERBOSE)
 The logging level for verbose information.
 
#define ARMARX_VERBOSE_S   _ARMARX_LOG_INTERNAL_S(::armarx::MessageTypeT::VERBOSE)
 
#define ARMARX_WARNING   _ARMARX_LOG_INTERNAL_(::armarx::MessageTypeT::WARN)
 The logging level for unexpected behaviour, but not a serious problem.
 
#define ARMARX_WARNING_S   _ARMARX_LOG_INTERNAL_S(::armarx::MessageTypeT::WARN)
 The logging level for unexpected behaviour, but not a serious problem.
 

Typedefs

using LogSenderPtr = std::shared_ptr<LogSender>
 Typedef of std::shared_ptr for convenience.
 
using SpamFilterDataPtr = std::shared_ptr<SpamFilterData>
 

Functions

bool checkLogLevel (armarx::MessageTypeT level)
 
armarx::SpamFilterDataPtr deactivateSpam (const std::string &identifier, float deactivationDurationSec=10.0f, bool deactivate=true)
 
armarx::SpamFilterDataPtr deactivateSpam (float deactivationDurationSec=10.0f, const std::string &identifier="", bool deactivate=true)
 
armarx::LogSenderPtr loghelper (const char *file, int line, const char *function)
 

Variables

const armarx::LogSender _GlobalDummyLogSender
 Dummy instance for faster skipped logging (if verbosity level is lower than selected level) - DO NOT USE THIS VARIABLE.
 

Macro Definition Documentation

◆ _ARMARX_LOG_INTERNAL_

#define _ARMARX_LOG_INTERNAL_ ( level)
Value:
: (*loghelper(__FILE__, __LINE__, ARMARX_FUNCTION)) << level
bool checkLogLevel(MessageTypeT level)
Definition Logging.cpp:150
LogSenderPtr loghelper(const char *file, int line, const char *function)
Definition Logging.cpp:143
#define ARMARX_FUNCTION
Definition Logging.h:122
const armarx::LogSender _GlobalDummyLogSender
Dummy instance for faster skipped logging (if verbosity level is lower than selected level) - DO NOT ...
Definition Logging.h:124

Definition at line 174 of file Logging.h.

◆ _ARMARX_LOG_INTERNAL_S

#define _ARMARX_LOG_INTERNAL_S ( level)
Value:
: ARMARX_LOG_S << level
static MessageTypeT GetGlobalMinimumLoggingLevel()
#define ARMARX_LOG_S
This macro creates a new temporary instance which can then be used to log data using the << operator.
Definition Logging.h:145

Definition at line 170 of file Logging.h.

◆ ARMARX_FUNCTION

#define ARMARX_FUNCTION   BOOST_CURRENT_FUNCTION

Definition at line 122 of file Logging.h.

◆ ARMARX_STREAM_PRINTER

#define ARMARX_STREAM_PRINTER   ::armarx::detail::StreamPrinterTag::tag* [&](std::ostream & out)

use this macro to write output code that is executed when printed and thus not executed if the debug level prevents printing.

In the code you should write to the stream out to output messages.

Example:

{
for (const std::string& elem : someSetOfStrings)
{
if(elem.size() == 5)
{
out << " " << elem << "\n";
}
}
};
#define ARMARX_STREAM_PRINTER
use this macro to write output code that is executed when printed and thus not executed if the debug ...
Definition Logging.h:310
#define ARMARX_DEBUG
The logging level for output that is only interesting while debugging.
Definition Logging.h:184

This code will only run if the effective debug level is Debug and only entries are printed which satisfy the if condition

Definition at line 310 of file Logging.h.

Function Documentation

◆ checkLogLevel()

bool checkLogLevel ( armarx::MessageTypeT level)

Definition at line 150 of file Logging.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deactivateSpam() [1/2]

armarx::SpamFilterDataPtr deactivateSpam ( const std::string & identifier,
float deactivationDurationSec = 10.0f,
bool deactivate = true )
inline

Definition at line 319 of file Logging.h.

+ Here is the call graph for this function:

◆ deactivateSpam() [2/2]

armarx::SpamFilterDataPtr deactivateSpam ( float deactivationDurationSec = 10.0f,
const std::string & identifier = "",
bool deactivate = true )

Definition at line 158 of file Logging.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loghelper()

armarx::LogSenderPtr loghelper ( const char * file,
int line,
const char * function )

Definition at line 143 of file Logging.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ _GlobalDummyLogSender

const armarx::LogSender _GlobalDummyLogSender

Dummy instance for faster skipped logging (if verbosity level is lower than selected level) - DO NOT USE THIS VARIABLE.

Definition at line 124 of file Logging.h.