logging.h File Reference
#include <mc_rtc/utils_api.h>
#include <iostream>
#include <spdlog/fmt/fmt.h>
#include <spdlog/fmt/ostr.h>
#include <spdlog/logger.h>
#include <boost/stacktrace.hpp>
Include dependency graph for logging.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 mc_rtc
 
 mc_rtc::log
 
 mc_rtc::log::details
 

Macros

#define MC_FMT_STREAMED(X)   X
 
#define BOOST_STACKTRACE_LINK
 
#define LOG_ERROR(args)
 
#define LOG_WARNING(args)
 
#define LOG_INFO(args)
 
#define LOG_SUCCESS(args)
 
#define LOG_ERROR_AND_THROW(exception_type, args)
 

Functions

MC_RTC_UTILS_DLLAPI spdlog::logger & mc_rtc::log::details::success ()
 
MC_RTC_UTILS_DLLAPI spdlog::logger & mc_rtc::log::details::info ()
 
MC_RTC_UTILS_DLLAPI spdlog::logger & mc_rtc::log::details::cerr ()
 
MC_RTC_UTILS_DLLAPI void mc_rtc::log::details::notify (const std::string &message)
 
MC_RTC_UTILS_DLLAPI void mc_rtc::log::details::disable_notifications ()
 
template<typename ExceptionT = std::runtime_error, typename... Args>
void mc_rtc::log::error_and_throw (Args &&... args)
 
template<typename... Args>
void mc_rtc::log::critical (Args &&... args)
 
template<typename... Args>
void mc_rtc::log::error (Args &&... args)
 
template<typename... Args>
void mc_rtc::log::warning (Args &&... args)
 
template<typename... Args>
void mc_rtc::log::info (Args &&... args)
 
template<typename... Args>
void mc_rtc::log::success (Args &&... args)
 
template<typename... Args>
void mc_rtc::log::notify (Args &&... args)
 

Variables

constexpr auto mc_rtc::OUT_NONE = "\033[00m"
 
constexpr auto mc_rtc::OUT_BLUE = "\033[01;34m"
 
constexpr auto mc_rtc::OUT_GREEN = "\033[01;32m"
 
constexpr auto mc_rtc::OUT_PURPLE = "\033[01;35m"
 
constexpr auto mc_rtc::OUT_RED = "\033[01;31m"
 

Macro Definition Documentation

◆ BOOST_STACKTRACE_LINK

#define BOOST_STACKTRACE_LINK

◆ LOG_ERROR

#define LOG_ERROR (   args)
Value:
_Pragma("GCC warning \"This macro is deprecated, use mc_rtc::log::error instead\""); \

◆ LOG_ERROR_AND_THROW

#define LOG_ERROR_AND_THROW (   exception_type,
  args 
)
Value:
{ \
_Pragma("GCC warning \"This macro is deprecated, use mc_rtc::log::error_and_throw<exception_type> instead\""); \
std::stringstream strstrm; \
strstrm << args; \
LOG_ERROR(strstrm.str()) \
throw exception_type(strstrm.str()); \
}

◆ LOG_INFO

#define LOG_INFO (   args)
Value:
_Pragma("GCC warning \"This macro is deprecated, use mc_rtc::log::info instead\""); \
std::cout << mc_rtc::OUT_BLUE << args << mc_rtc::OUT_NONE << "\n";

◆ LOG_SUCCESS

#define LOG_SUCCESS (   args)
Value:
_Pragma("GCC warning \"This macro is deprecated, use mc_rtc::log::success instead\""); \
std::cout << mc_rtc::OUT_GREEN << args << mc_rtc::OUT_NONE << "\n";

◆ LOG_WARNING

#define LOG_WARNING (   args)
Value:
_Pragma("GCC warning \"This macro is deprecated, use mc_rtc::log::warning instead\""); \

◆ MC_FMT_STREAMED

#define MC_FMT_STREAMED (   X)    X
mc_rtc::OUT_BLUE
constexpr auto OUT_BLUE
Definition: logging.h:102
mc_rtc::OUT_NONE
constexpr auto OUT_NONE
Definition: logging.h:101
mc_rtc::OUT_RED
constexpr auto OUT_RED
Definition: logging.h:105
mc_rtc::OUT_GREEN
constexpr auto OUT_GREEN
Definition: logging.h:103
mc_rtc::OUT_PURPLE
constexpr auto OUT_PURPLE
Definition: logging.h:104
mc_rtc::log::details::cerr
MC_RTC_UTILS_DLLAPI spdlog::logger & cerr()