33#ifndef DART_COMMON_DETAIL_LOGGING_IMPL_HPP_
34#define DART_COMMON_DETAIL_LOGGING_IMPL_HPP_
39 #include <spdlog/spdlog.h>
51template <
typename S1,
typename S2>
52void print(std::ostream& os,
const S1& header,
const S2& format_str,
int color)
54 os <<
"\033[1;" << color <<
"m" << header <<
"\033[0m " << format_str
59template <
typename S,
typename Arg,
typename... Args>
63 std::string format_str,
68 os <<
"\033[1;" << color <<
"m" << header <<
"\033[0m " << format_str
70 os << std::forward<Arg>(arg);
71 ((os <<
", " << std::forward<Args>(args)), ...);
79template <
typename S,
typename... Args>
80void trace(
const S& format_str, [[maybe_unused]] Args&&... args)
83 spdlog::trace(format_str, std::forward<Args>(args)...);
86 std::cout,
"[trace]", format_str, 38, std::forward<Args>(args)...);
91template <
typename S,
typename... Args>
92void debug(
const S& format_str, [[maybe_unused]] Args&&... args)
95 spdlog::debug(format_str, std::forward<Args>(args)...);
98 std::cout,
"[debug]", format_str, 36, std::forward<Args>(args)...);
103template <
typename S,
typename... Args>
104void info(
const S& format_str, [[maybe_unused]] Args&&... args)
107 spdlog::info(format_str, std::forward<Args>(args)...);
110 std::cout,
"[info]", format_str, 32, std::forward<Args>(args)...);
115template <
typename S,
typename... Args>
116void warn(
const S& format_str, [[maybe_unused]] Args&&... args)
119 spdlog::warn(format_str, std::forward<Args>(args)...);
122 std::cerr,
"[warn]", format_str, 33, std::forward<Args>(args)...);
127template <
typename S,
typename... Args>
128void error(
const S& format_str, [[maybe_unused]] Args&&... args)
131 spdlog::error(format_str, std::forward<Args>(args)...);
134 std::cerr,
"[error]", format_str, 31, std::forward<Args>(args)...);
139template <
typename S,
typename... Args>
140void fatal(
const S& format_str, [[maybe_unused]] Args&&... args)
143 spdlog::critical(format_str, std::forward<Args>(args)...);
146 std::cerr,
"[fatal]", format_str, 35, std::forward<Args>(args)...);
void print(std::ostream &os, const S1 &header, const S2 &format_str, int color)
Definition Logging-impl.hpp:52
void fatal(const S &format_str, Args &&... args)
Logs for a fatal error message.
Definition Logging-impl.hpp:140
void info(const S &format_str, Args &&... args)
Logs for a information message.
Definition Logging-impl.hpp:104
void warn(const S &format_str, Args &&... args)
Logs for a warning message.
Definition Logging-impl.hpp:116
void trace(const S &format_str, Args &&... args)
Logs for a trace message.
Definition Logging-impl.hpp:80
void error(const S &format_str, Args &&... args)
Logs for a error message.
Definition Logging-impl.hpp:128
const bool debug
Definition urdf_world_parser.cpp:49