spdlog
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions
common.h File Reference

Go to the source code of this file.

#include <spdlog/tweakme.h>
#include <spdlog/details/null_mutex.h>
#include <atomic>
#include <chrono>
#include <initializer_list>
#include <memory>
#include <exception>
#include <string>
#include <type_traits>
#include <functional>
#include <spdlog/fmt/fmt.h>
#include "common-inl.h"

Classes

struct  spdlog::is_convertible_to_basic_format_string< T, Char >
 
struct  spdlog::is_convertible_to_any_format_string< T >
 
class  spdlog::spdlog_ex
 
struct  spdlog::source_loc
 

Namespaces

namespace  spdlog
 
namespace  spdlog::sinks
 
namespace  spdlog::level
 
namespace  spdlog::details
 

Macros

#define SPDLOG_API
 
#define SPDLOG_HEADER_ONLY
 
#define SPDLOG_INLINE   inline
 
#define SPDLOG_FMT_RUNTIME(format_string)   format_string
 
#define SPDLOG_NOEXCEPT   noexcept
 
#define SPDLOG_CONSTEXPR   constexpr
 
#define SPDLOG_DEPRECATED
 
#define SPDLOG_FUNCTION   static_cast<const char *>(__FUNCTION__)
 
#define SPDLOG_TRY   try
 
#define SPDLOG_THROW(ex)   throw(ex)
 
#define SPDLOG_CATCH_STD    catch (const std::exception &) {}
 
#define SPDLOG_FILENAME_T(s)   s
 
#define SPDLOG_LEVEL_TRACE   0
 
#define SPDLOG_LEVEL_DEBUG   1
 
#define SPDLOG_LEVEL_INFO   2
 
#define SPDLOG_LEVEL_WARN   3
 
#define SPDLOG_LEVEL_ERROR   4
 
#define SPDLOG_LEVEL_CRITICAL   5
 
#define SPDLOG_LEVEL_OFF   6
 
#define SPDLOG_ACTIVE_LEVEL   SPDLOG_LEVEL_INFO
 
#define SPDLOG_LEVEL_NAME_TRACE   spdlog::string_view_t("trace", 5)
 
#define SPDLOG_LEVEL_NAME_DEBUG   spdlog::string_view_t("debug", 5)
 
#define SPDLOG_LEVEL_NAME_INFO   spdlog::string_view_t("info", 4)
 
#define SPDLOG_LEVEL_NAME_WARNING   spdlog::string_view_t("warning", 7)
 
#define SPDLOG_LEVEL_NAME_ERROR   spdlog::string_view_t("error", 5)
 
#define SPDLOG_LEVEL_NAME_CRITICAL   spdlog::string_view_t("critical", 8)
 
#define SPDLOG_LEVEL_NAME_OFF   spdlog::string_view_t("off", 3)
 
#define SPDLOG_LEVEL_NAMES
 
#define SPDLOG_SHORT_LEVEL_NAMES
 

Typedefs

using spdlog::filename_t = std::string
 
using spdlog::log_clock = std::chrono::system_clock
 
using spdlog::sink_ptr = std::shared_ptr< sinks::sink >
 
using spdlog::sinks_init_list = std::initializer_list< sink_ptr >
 
using spdlog::err_handler = std::function< void(const std::string &err_msg)>
 
using spdlog::string_view_t = fmt::basic_string_view< char >
 
using spdlog::wstring_view_t = fmt::basic_string_view< wchar_t >
 
using spdlog::memory_buf_t = fmt::basic_memory_buffer< char, 250 >
 
using spdlog::wmemory_buf_t = fmt::basic_memory_buffer< wchar_t, 250 >
 
template<class T >
using spdlog::remove_cvref_t = typename std::remove_cv< typename std::remove_reference< T >::type >::type
 
using spdlog::level_t = std::atomic< int >
 

Enumerations

enum  spdlog::level::level_enum {
  spdlog::level::trace = SPDLOG_LEVEL_TRACE ,
  spdlog::level::debug = SPDLOG_LEVEL_DEBUG ,
  spdlog::level::info = SPDLOG_LEVEL_INFO ,
  spdlog::level::warn = SPDLOG_LEVEL_WARN ,
  spdlog::level::err = SPDLOG_LEVEL_ERROR ,
  spdlog::level::critical = SPDLOG_LEVEL_CRITICAL ,
  spdlog::level::off = SPDLOG_LEVEL_OFF ,
  spdlog::level::n_levels
}
 
enum class  spdlog::color_mode {
  spdlog::always ,
  spdlog::automatic ,
  spdlog::never
}
 
enum class  spdlog::pattern_time_type {
  spdlog::local ,
  spdlog::utc
}
 

Functions

SPDLOG_INLINE const string_view_tspdlog::level::to_string_view (spdlog::level::level_enum l) SPDLOG_NOEXCEPT
 
SPDLOG_INLINE const charspdlog::level::to_short_c_str (spdlog::level::level_enum l) SPDLOG_NOEXCEPT
 
SPDLOG_INLINE spdlog::level::level_enum spdlog::level::from_str (const std::string &name) SPDLOG_NOEXCEPT
 
SPDLOG_INLINE void spdlog::throw_spdlog_ex (const std::string &msg, int last_errno)
 
SPDLOG_INLINE void spdlog::throw_spdlog_ex (std::string msg)
 
template<typename T , typename... Args>
std::unique_ptr< Tspdlog::details::make_unique (Args &&...args)
 

Macro Definition Documentation

◆ SPDLOG_ACTIVE_LEVEL

#define SPDLOG_ACTIVE_LEVEL   SPDLOG_LEVEL_INFO

Definition at line 156 of file common.h.

◆ SPDLOG_API

#define SPDLOG_API

Definition at line 31 of file common.h.

◆ SPDLOG_CATCH_STD

#define SPDLOG_CATCH_STD    catch (const std::exception &) {}

Definition at line 88 of file common.h.

◆ SPDLOG_CONSTEXPR

#define SPDLOG_CONSTEXPR   constexpr

Definition at line 54 of file common.h.

◆ SPDLOG_DEPRECATED

#define SPDLOG_DEPRECATED

Definition at line 62 of file common.h.

◆ SPDLOG_FILENAME_T

#define SPDLOG_FILENAME_T (   s)    s

Definition at line 107 of file common.h.

◆ SPDLOG_FMT_RUNTIME

#define SPDLOG_FMT_RUNTIME (   format_string)    format_string

Definition at line 45 of file common.h.

◆ SPDLOG_FUNCTION

#define SPDLOG_FUNCTION   static_cast<const char *>(__FUNCTION__)

Definition at line 73 of file common.h.

◆ SPDLOG_HEADER_ONLY

#define SPDLOG_HEADER_ONLY

Definition at line 32 of file common.h.

◆ SPDLOG_INLINE

#define SPDLOG_INLINE   inline

Definition at line 33 of file common.h.

◆ SPDLOG_LEVEL_CRITICAL

#define SPDLOG_LEVEL_CRITICAL   5

Definition at line 152 of file common.h.

◆ SPDLOG_LEVEL_DEBUG

#define SPDLOG_LEVEL_DEBUG   1

Definition at line 148 of file common.h.

◆ SPDLOG_LEVEL_ERROR

#define SPDLOG_LEVEL_ERROR   4

Definition at line 151 of file common.h.

◆ SPDLOG_LEVEL_INFO

#define SPDLOG_LEVEL_INFO   2

Definition at line 149 of file common.h.

◆ SPDLOG_LEVEL_NAME_CRITICAL

#define SPDLOG_LEVEL_NAME_CRITICAL   spdlog::string_view_t("critical", 8)

Definition at line 178 of file common.h.

◆ SPDLOG_LEVEL_NAME_DEBUG

#define SPDLOG_LEVEL_NAME_DEBUG   spdlog::string_view_t("debug", 5)

Definition at line 174 of file common.h.

◆ SPDLOG_LEVEL_NAME_ERROR

#define SPDLOG_LEVEL_NAME_ERROR   spdlog::string_view_t("error", 5)

Definition at line 177 of file common.h.

◆ SPDLOG_LEVEL_NAME_INFO

#define SPDLOG_LEVEL_NAME_INFO   spdlog::string_view_t("info", 4)

Definition at line 175 of file common.h.

◆ SPDLOG_LEVEL_NAME_OFF

#define SPDLOG_LEVEL_NAME_OFF   spdlog::string_view_t("off", 3)

Definition at line 179 of file common.h.

◆ SPDLOG_LEVEL_NAME_TRACE

#define SPDLOG_LEVEL_NAME_TRACE   spdlog::string_view_t("trace", 5)

Definition at line 173 of file common.h.

◆ SPDLOG_LEVEL_NAME_WARNING

#define SPDLOG_LEVEL_NAME_WARNING   spdlog::string_view_t("warning", 7)

Definition at line 176 of file common.h.

◆ SPDLOG_LEVEL_NAMES

#define SPDLOG_LEVEL_NAMES
Value:
{ \
}
#define SPDLOG_LEVEL_NAME_TRACE
Definition common.h:173
#define SPDLOG_LEVEL_NAME_OFF
Definition common.h:179
#define SPDLOG_LEVEL_NAME_WARNING
Definition common.h:176
#define SPDLOG_LEVEL_NAME_ERROR
Definition common.h:177
#define SPDLOG_LEVEL_NAME_CRITICAL
Definition common.h:178
#define SPDLOG_LEVEL_NAME_INFO
Definition common.h:175
#define SPDLOG_LEVEL_NAME_DEBUG
Definition common.h:174

Definition at line 182 of file common.h.

◆ SPDLOG_LEVEL_OFF

#define SPDLOG_LEVEL_OFF   6

Definition at line 153 of file common.h.

◆ SPDLOG_LEVEL_TRACE

#define SPDLOG_LEVEL_TRACE   0

Definition at line 147 of file common.h.

◆ SPDLOG_LEVEL_WARN

#define SPDLOG_LEVEL_WARN   3

Definition at line 150 of file common.h.

◆ SPDLOG_NOEXCEPT

#define SPDLOG_NOEXCEPT   noexcept

Definition at line 53 of file common.h.

◆ SPDLOG_SHORT_LEVEL_NAMES

#define SPDLOG_SHORT_LEVEL_NAMES
Value:
{ \
"T", "D", "I", "W", "E", "C", "O" \
}

Definition at line 191 of file common.h.

◆ SPDLOG_THROW

#define SPDLOG_THROW (   ex)    throw(ex)

Definition at line 87 of file common.h.

◆ SPDLOG_TRY

#define SPDLOG_TRY   try

Definition at line 86 of file common.h.