27 template<
typename Sink,
typename... SinkArgs>
30 auto sink = std::make_shared<Sink>(std::forward<SinkArgs>(
args)...);
44 template<
typename Sink,
typename... SinkArgs>
45 inline std::shared_ptr<spdlog::logger>
create(
std::string logger_name, SinkArgs &&... sink_args)
47 return default_factory::create<Sink>(
std::move(logger_name), std::forward<SinkArgs>(sink_args)...);
164 template<
typename... Args>
170 template<
typename... Args>
176 template<
typename... Args>
182 template<
typename... Args>
188 template<
typename... Args>
194 template<
typename... Args>
200 template<
typename... Args>
206 template<
typename... Args>
254 #ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT 255 template<
typename... Args>
261 template<
typename... Args>
262 inline void trace(
const wchar_t *fmt,
const Args &... args)
267 template<
typename... Args>
268 inline void debug(
const wchar_t *fmt,
const Args &... args)
273 template<
typename... Args>
274 inline void info(
const wchar_t *fmt,
const Args &... args)
279 template<
typename... Args>
280 inline void warn(
const wchar_t *fmt,
const Args &... args)
285 template<
typename... Args>
286 inline void error(
const wchar_t *fmt,
const Args &... args)
291 template<
typename... Args>
292 inline void critical(
const wchar_t *fmt,
const Args &... args)
297 #endif // SPDLOG_WCHAR_TO_UTF8_SUPPORT 314 #define SPDLOG_LOGGER_CALL(logger, level, ...) \ 315 if (logger->should_log(level)) \ 316 logger->log(spdlog::source_loc{SPDLOG_FILE_BASENAME(__FILE__), __LINE__, SPDLOG_FUNCTION}, level, __VA_ARGS__) 318 #if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_TRACE 319 #define SPDLOG_LOGGER_TRACE(logger, ...) SPDLOG_LOGGER_CALL(logger, spdlog::level::trace, __VA_ARGS__) 320 #define SPDLOG_TRACE(...) SPDLOG_LOGGER_TRACE(spdlog::default_logger_raw(), __VA_ARGS__) 322 #define SPDLOG_LOGGER_TRACE(logger, ...) (void)0 323 #define SPDLOG_TRACE(...) (void)0 326 #if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_DEBUG 327 #define SPDLOG_LOGGER_DEBUG(logger, ...) SPDLOG_LOGGER_CALL(logger, spdlog::level::debug, __VA_ARGS__) 328 #define SPDLOG_DEBUG(...) SPDLOG_LOGGER_DEBUG(spdlog::default_logger_raw(), __VA_ARGS__) 330 #define SPDLOG_LOGGER_DEBUG(logger, ...) (void)0 331 #define SPDLOG_DEBUG(...) (void)0 334 #if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_INFO 335 #define SPDLOG_LOGGER_INFO(logger, ...) SPDLOG_LOGGER_CALL(logger, spdlog::level::info, __VA_ARGS__) 336 #define SPDLOG_INFO(...) SPDLOG_LOGGER_INFO(spdlog::default_logger_raw(), __VA_ARGS__) 338 #define SPDLOG_LOGGER_INFO(logger, ...) (void)0 339 #define SPDLOG_INFO(...) (void)0 342 #if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_WARN 343 #define SPDLOG_LOGGER_WARN(logger, ...) SPDLOG_LOGGER_CALL(logger, spdlog::level::warn, __VA_ARGS__) 344 #define SPDLOG_WARN(...) SPDLOG_LOGGER_WARN(spdlog::default_logger_raw(), __VA_ARGS__) 346 #define SPDLOG_LOGGER_WARN(logger, ...) (void)0 347 #define SPDLOG_WARN(...) (void)0 350 #if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_ERROR 351 #define SPDLOG_LOGGER_ERROR(logger, ...) SPDLOG_LOGGER_CALL(logger, spdlog::level::err, __VA_ARGS__) 352 #define SPDLOG_ERROR(...) SPDLOG_LOGGER_ERROR(spdlog::default_logger_raw(), __VA_ARGS__) 354 #define SPDLOG_LOGGER_ERROR(logger, ...) (void)0 355 #define SPDLOG_ERROR(...) (void)0 358 #if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_CRITICAL 359 #define SPDLOG_LOGGER_CRITICAL(logger, ...) SPDLOG_LOGGER_CALL(logger, spdlog::level::critical, __VA_ARGS__) 360 #define SPDLOG_CRITICAL(...) SPDLOG_LOGGER_CRITICAL(spdlog::default_logger_raw(), __VA_ARGS__) 362 #define SPDLOG_LOGGER_CRITICAL(logger, ...) (void)0 363 #define SPDLOG_CRITICAL(...) (void)0
void error(const char *fmt, const Args &...args)
void warn(const char *fmt, const Args &...args)
void apply_all(const std::function< void(const std::shared_ptr< logger >)> &fun)
void msg(const char *fmt,...)
void info(const char *fmt, const Args &...args)
void set_formatter(std::unique_ptr< formatter > formatter)
void log(level::level_enum lvl, const char *fmt, const Args &...args)
void flush_on(level::level_enum log_level)
void info(const char *fmt, const Args &...args)
void flush_every(std::chrono::seconds interval)
void drop(const std::string &name)
void set_automatic_registration(bool automatic_registation)
static registry & instance()
void set_error_handler(log_err_handler handler)
void flush_on(level::level_enum log_level)
static std::shared_ptr< spdlog::logger > create(std::string logger_name, SinkArgs &&...args)
void critical(const char *fmt, const Args &...args)
void set_error_handler(log_err_handler handler)
std::shared_ptr< logger > get(const std::string &logger_name)
void set_default_logger(std::shared_ptr< spdlog::logger > default_logger)
void set_level(level::level_enum log_level)
second seconds
Alias for common language habits.
spdlog::logger * default_logger_raw()
void initialize_logger(std::shared_ptr< logger > new_logger)
void critical(const char *fmt, const Args &...args)
void set_default_logger(std::shared_ptr< logger > new_default_logger)
void warn(const char *fmt, const Args &...args)
void debug(const char *fmt, const Args &...args)
void log(source_loc source, level::level_enum lvl, const char *fmt, const Args &...args)
std::shared_ptr< spdlog::logger > default_logger()
void set_automatic_registration(bool automatic_regsistration)
void set_pattern(std::string pattern, pattern_time_type time_type=pattern_time_type::local)
void register_logger(std::shared_ptr< logger > logger)
void flush_every(std::chrono::seconds interval)
void trace(const char *fmt, const Args &...args)
void debug(const char *fmt, const Args &...args)
static msg_handler handler
void apply_all(const std::function< void(std::shared_ptr< logger >)> &fun)
void function(int client, int *resource, int parblock, int *test, int p)
void drop(const std::string &logger_name)
std::function< void(const std::string &err_msg)> log_err_handler
void register_logger(std::shared_ptr< logger > new_logger)
void set_formatter(std::unique_ptr< spdlog::formatter > formatter)
logger * get_default_raw()
void set_level(level::level_enum log_level)
void trace(const char *fmt, const Args &...args)
std::shared_ptr< logger > default_logger()
void error(const char *fmt, const Args &...args)