13 #include <initializer_list> 18 #include <type_traits> 19 #include <unordered_map> 21 #if defined(SPDLOG_WCHAR_FILENAMES) || defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) 31 #if defined(_MSC_VER) && (_MSC_VER < 1900) 32 #define SPDLOG_NOEXCEPT throw() 33 #define SPDLOG_CONSTEXPR 35 #define SPDLOG_NOEXCEPT noexcept 36 #define SPDLOG_CONSTEXPR constexpr 39 #if defined(__GNUC__) || defined(__clang__) 40 #define SPDLOG_DEPRECATED __attribute__((deprecated)) 41 #elif defined(_MSC_VER) 42 #define SPDLOG_DEPRECATED __declspec(deprecated) 44 #define SPDLOG_DEPRECATED 49 #if (defined(_MSC_VER) && (_MSC_VER < 1900)) || defined(__cplusplus_winrt) 50 #define SPDLOG_NO_TLS 1 55 #if FMT_HAS_FEATURE(__builtin_strrchr) 56 #define SPDLOG_STRRCHR(str, sep) __builtin_strrchr(str, sep) 58 #define SPDLOG_STRRCHR(str, sep) strrchr(str, sep) 59 #endif //__builtin_strrchr not defined 62 #define SPDLOG_FILE_BASENAME(file) SPDLOG_STRRCHR("\\" file, '\\') + 1 64 #define SPDLOG_FILE_BASENAME(file) SPDLOG_STRRCHR("/" file, '/') + 1 67 #ifndef SPDLOG_FUNCTION 68 #define SPDLOG_FUNCTION __FUNCTION__ 85 #if defined(FMT_USE_STD_STRING_VIEW) 91 #if defined(SPDLOG_NO_ATOMIC_LEVELS) 97 #define SPDLOG_LEVEL_TRACE 0 98 #define SPDLOG_LEVEL_DEBUG 1 99 #define SPDLOG_LEVEL_INFO 2 100 #define SPDLOG_LEVEL_WARN 3 101 #define SPDLOG_LEVEL_ERROR 4 102 #define SPDLOG_LEVEL_CRITICAL 5 103 #define SPDLOG_LEVEL_OFF 6 105 #if !defined(SPDLOG_ACTIVE_LEVEL) 106 #define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_INFO 122 #if !defined(SPDLOG_LEVEL_NAMES) 123 #define SPDLOG_LEVEL_NAMES \ 125 "trace", "debug", "info", "warning", "error", "critical", "off" \ 130 #if !defined(SPDLOG_SHORT_LEVEL_NAMES) 131 #define SPDLOG_SHORT_LEVEL_NAMES {"T", "D", "I", "W", "E", "C", "O"} 150 if (level_str == name)
179 : msg_(
std::move(msg))
202 #if defined(_WIN32) && defined(SPDLOG_WCHAR_FILENAMES) 217 : filename{filename_in}
218 , line{
static_cast<uint32_t
>(line_in)}
219 , funcname{funcname_in}
235 #if __cplusplus >= 201402L // C++14 and beyond 238 template<
typename T,
typename... Args>
241 static_assert(!std::is_array<T>::value,
"arrays not supported");
242 return std::unique_ptr<T>(
new T(std::forward<Args>(args)...));
spdlog::level::level_enum from_str(const std::string &name) noexcept
std::initializer_list< sink_ptr > sinks_init_list
#define SPDLOG_LEVEL_WARN
void info(const char *fmt, const Args &...args)
constexpr source_loc(const char *filename_in, int line_in, const char *funcname_in)
#define SPDLOG_LEVEL_INFO
#define SPDLOG_LEVEL_NAMES
#define SPDLOG_LEVEL_TRACE
#define SPDLOG_LEVEL_DEBUG
std::shared_ptr< sinks::sink > sink_ptr
#define SPDLOG_SHORT_LEVEL_NAMES
spdlog_ex(const std::string &msg, int last_errno)
std::hash< int > level_hasher
static string_view_t level_string_views[]
void critical(const char *fmt, const Args &...args)
const char * to_short_c_str(spdlog::level::level_enum l) noexcept
#define SPDLOG_LEVEL_ERROR
spdlog_ex(std::string msg)
std::chrono::system_clock log_clock
constexpr bool empty() const noexcept
std::unique_ptr< T > make_unique(Args &&...args)
void warn(const char *fmt, const Args &...args)
string_view_t & to_string_view(spdlog::level::level_enum l) noexcept
void debug(const char *fmt, const Args &...args)
std::atomic< int > level_t
std::string to_string(const T &value)
static const char * short_level_names[]
void format_system_error(internal::buffer &out, int error_code, string_view message)
#define SPDLOG_LEVEL_CRITICAL
std::function< void(const std::string &err_msg)> log_err_handler
basic_string_view< char > string_view
void trace(const char *fmt, const Args &...args)
const char * what() const noexceptoverride