11#define LIBCARLA_LOG_LEVEL_DEBUG 10
12#define LIBCARLA_LOG_LEVEL_INFO 20
13#define LIBCARLA_LOG_LEVEL_WARNING 30
14#define LIBCARLA_LOG_LEVEL_ERROR 40
15#define LIBCARLA_LOG_LEVEL_CRITICAL 50
16#define LIBCARLA_LOG_LEVEL_NONE 100
18#ifndef LIBCARLA_LOG_LEVEL
20# define LIBCARLA_LOG_LEVEL LIBCARLA_LOG_LEVEL_WARNING
22# define LIBCARLA_LOG_LEVEL LIBCARLA_LOG_LEVEL_INFO
50 template <
typename Arg,
typename ... Args>
54 out << std::boolalpha << std::forward<Arg>(arg);
56 using expander =
int[];
57 (void) expander{0, (void(out <<
' ' << std::forward<Args>(args)), 0) ...};
60 template <
typename ... Args>
61 static inline void log(Args && ... args) {
68#if LIBCARLA_LOG_LEVEL <= LIBCARLA_LOG_LEVEL_DEBUG
70 template <
typename ... Args>
78 template <
typename ... Args>
79 static inline void log_debug(Args && ...) {}
83#if LIBCARLA_LOG_LEVEL <= LIBCARLA_LOG_LEVEL_INFO
85 template <
typename ... Args>
86 static inline void log_info(Args && ... args) {
93 template <
typename ... Args>
94 static inline void log_info(Args && ...) {}
98#if LIBCARLA_LOG_LEVEL <= LIBCARLA_LOG_LEVEL_WARNING
100 template <
typename ... Args>
107 template <
typename ... Args>
112#if LIBCARLA_LOG_LEVEL <= LIBCARLA_LOG_LEVEL_ERROR
114 template <
typename ... Args>
122 template <
typename ... Args>
123 static inline void log_error(Args && ...) {}
127#if LIBCARLA_LOG_LEVEL <= LIBCARLA_LOG_LEVEL_CRITICAL
129 template <
typename ... Args>
137 template <
typename ... Args>
148#if LIBCARLA_LOG_LEVEL <= LIBCARLA_LOG_LEVEL_DEBUG
149# define LOG_DEBUG_ONLY(code) code
152# define LOG_DEBUG_ONLY(code)
155#if LIBCARLA_LOG_LEVEL <= LIBCARLA_LOG_LEVEL_INFO
156# define LOG_INFO_ONLY(code) code
160# define LOG_INFO_ONLY(code)
static LIBCARLA_NOINLINE void write_to_stream(std::ostream &out, Arg &&arg, Args &&... args)
static void log(Args &&... args)
static void log_error(Args &&... args)
static void log_info(Args &&... args)
static void log_warning(Args &&... args)
static void log_critical(Args &&... args)
static void log_debug(Args &&... args)