Classes | Namespaces | Macros | Typedefs | Functions
spdlog.h File Reference
#include "spdlog/common.h"
#include "spdlog/details/registry.h"
#include "spdlog/logger.h"
#include "spdlog/version.h"
#include <chrono>
#include <functional>
#include <memory>
#include <string>

Go to the source code of this file.

Classes

struct  spdlog::synchronous_factory
 

Namespaces

 spdlog
 

Macros

#define SPDLOG_LOGGER_CALL(logger, level, ...)
 
#define SPDLOG_LOGGER_TRACE(logger, ...)   SPDLOG_LOGGER_CALL(logger, spdlog::level::trace, __VA_ARGS__)
 
#define SPDLOG_TRACE(...)   SPDLOG_LOGGER_TRACE(spdlog::default_logger_raw(), __VA_ARGS__)
 
#define SPDLOG_LOGGER_DEBUG(logger, ...)   SPDLOG_LOGGER_CALL(logger, spdlog::level::debug, __VA_ARGS__)
 
#define SPDLOG_DEBUG(...)   SPDLOG_LOGGER_DEBUG(spdlog::default_logger_raw(), __VA_ARGS__)
 
#define SPDLOG_LOGGER_INFO(logger, ...)   SPDLOG_LOGGER_CALL(logger, spdlog::level::info, __VA_ARGS__)
 
#define SPDLOG_INFO(...)   SPDLOG_LOGGER_INFO(spdlog::default_logger_raw(), __VA_ARGS__)
 
#define SPDLOG_LOGGER_WARN(logger, ...)   SPDLOG_LOGGER_CALL(logger, spdlog::level::warn, __VA_ARGS__)
 
#define SPDLOG_WARN(...)   SPDLOG_LOGGER_WARN(spdlog::default_logger_raw(), __VA_ARGS__)
 
#define SPDLOG_LOGGER_ERROR(logger, ...)   SPDLOG_LOGGER_CALL(logger, spdlog::level::err, __VA_ARGS__)
 
#define SPDLOG_ERROR(...)   SPDLOG_LOGGER_ERROR(spdlog::default_logger_raw(), __VA_ARGS__)
 
#define SPDLOG_LOGGER_CRITICAL(logger, ...)   SPDLOG_LOGGER_CALL(logger, spdlog::level::critical, __VA_ARGS__)
 
#define SPDLOG_CRITICAL(...)   SPDLOG_LOGGER_CRITICAL(spdlog::default_logger_raw(), __VA_ARGS__)
 

Typedefs

using spdlog::default_factory = synchronous_factory
 

Functions

template<typename Sink , typename... SinkArgs>
std::shared_ptr< spdlog::loggerspdlog::create (std::string logger_name, SinkArgs &&...sink_args)
 
std::shared_ptr< logger > spdlog::get (const std::string &name)
 
void spdlog::set_formatter (std::unique_ptr< spdlog::formatter > formatter)
 
void spdlog::set_pattern (std::string pattern, pattern_time_type time_type=pattern_time_type::local)
 
void spdlog::set_level (level::level_enum log_level)
 
void spdlog::flush_on (level::level_enum log_level)
 
void spdlog::flush_every (std::chrono::seconds interval)
 
void spdlog::set_error_handler (log_err_handler handler)
 
void spdlog::register_logger (std::shared_ptr< logger > logger)
 
void spdlog::apply_all (const std::function< void(std::shared_ptr< logger >)> &fun)
 
void spdlog::drop (const std::string &name)
 
void spdlog::drop_all ()
 
void spdlog::shutdown ()
 
void spdlog::set_automatic_registration (bool automatic_registation)
 
std::shared_ptr< spdlog::loggerspdlog::default_logger ()
 
spdlog::loggerspdlog::default_logger_raw ()
 
void spdlog::set_default_logger (std::shared_ptr< spdlog::logger > default_logger)
 
template<typename... Args>
void spdlog::log (source_loc source, level::level_enum lvl, const char *fmt, const Args &...args)
 
template<typename... Args>
void spdlog::log (level::level_enum lvl, const char *fmt, const Args &...args)
 
template<typename... Args>
void spdlog::trace (const char *fmt, const Args &...args)
 
template<typename... Args>
void spdlog::debug (const char *fmt, const Args &...args)
 
template<typename... Args>
void spdlog::info (const char *fmt, const Args &...args)
 
template<typename... Args>
void spdlog::warn (const char *fmt, const Args &...args)
 
template<typename... Args>
void spdlog::error (const char *fmt, const Args &...args)
 
template<typename... Args>
void spdlog::critical (const char *fmt, const Args &...args)
 
template<typename T >
void spdlog::log (level::level_enum lvl, const T &msg)
 
template<typename T >
void spdlog::trace (const T &msg)
 
template<typename T >
void spdlog::debug (const T &msg)
 
template<typename T >
void spdlog::info (const T &msg)
 
template<typename T >
void spdlog::warn (const T &msg)
 
template<typename T >
void spdlog::error (const T &msg)
 
template<typename T >
void spdlog::critical (const T &msg)
 

Macro Definition Documentation

#define SPDLOG_CRITICAL (   ...)    SPDLOG_LOGGER_CRITICAL(spdlog::default_logger_raw(), __VA_ARGS__)

Definition at line 360 of file spdlog.h.

#define SPDLOG_DEBUG (   ...)    SPDLOG_LOGGER_DEBUG(spdlog::default_logger_raw(), __VA_ARGS__)

Definition at line 328 of file spdlog.h.

#define SPDLOG_ERROR (   ...)    SPDLOG_LOGGER_ERROR(spdlog::default_logger_raw(), __VA_ARGS__)

Definition at line 352 of file spdlog.h.

#define SPDLOG_INFO (   ...)    SPDLOG_LOGGER_INFO(spdlog::default_logger_raw(), __VA_ARGS__)

Definition at line 336 of file spdlog.h.

#define SPDLOG_LOGGER_CALL (   logger,
  level,
  ... 
)
Value:
if (logger->should_log(level)) \
logger->log(spdlog::source_loc{SPDLOG_FILE_BASENAME(__FILE__), __LINE__, SPDLOG_FUNCTION}, level, __VA_ARGS__)
logptr_t logger(std::string name)
Definition: Logging.cxx:71

Definition at line 314 of file spdlog.h.

#define SPDLOG_LOGGER_CRITICAL (   logger,
  ... 
)    SPDLOG_LOGGER_CALL(logger, spdlog::level::critical, __VA_ARGS__)

Definition at line 359 of file spdlog.h.

#define SPDLOG_LOGGER_DEBUG (   logger,
  ... 
)    SPDLOG_LOGGER_CALL(logger, spdlog::level::debug, __VA_ARGS__)

Definition at line 327 of file spdlog.h.

#define SPDLOG_LOGGER_ERROR (   logger,
  ... 
)    SPDLOG_LOGGER_CALL(logger, spdlog::level::err, __VA_ARGS__)

Definition at line 351 of file spdlog.h.

#define SPDLOG_LOGGER_INFO (   logger,
  ... 
)    SPDLOG_LOGGER_CALL(logger, spdlog::level::info, __VA_ARGS__)

Definition at line 335 of file spdlog.h.

#define SPDLOG_LOGGER_TRACE (   logger,
  ... 
)    SPDLOG_LOGGER_CALL(logger, spdlog::level::trace, __VA_ARGS__)

Definition at line 319 of file spdlog.h.

#define SPDLOG_LOGGER_WARN (   logger,
  ... 
)    SPDLOG_LOGGER_CALL(logger, spdlog::level::warn, __VA_ARGS__)

Definition at line 343 of file spdlog.h.

#define SPDLOG_TRACE (   ...)    SPDLOG_LOGGER_TRACE(spdlog::default_logger_raw(), __VA_ARGS__)

Definition at line 320 of file spdlog.h.

#define SPDLOG_WARN (   ...)    SPDLOG_LOGGER_WARN(spdlog::default_logger_raw(), __VA_ARGS__)

Definition at line 344 of file spdlog.h.