Agora  1.2.0
Agora project
common.h File Reference
#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 <cstdio>
#include <spdlog/fmt/fmt.h>
#include "common-inl.h"
Include dependency graph for common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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
 
struct  spdlog::file_event_handlers
 

Namespaces

 spdlog
 
 spdlog::sinks
 
 spdlog::level
 
 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_CONSTEXPR_FUNC
 
#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::memory_buf_t = fmt::basic_memory_buffer< char, 250 >
 
template<typename... Args>
using spdlog::format_string_t = fmt::format_string< Args... >
 
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 >
 
template<bool B, class T = void>
using spdlog::details::enable_if_t = typename std::enable_if< B, T >::type
 

Enumerations

enum  spdlog::level::level_enum : int {
  spdlog::level::trace = 0, spdlog::level::debug = 1, spdlog::level::info = 2, spdlog::level::warn = 3,
  spdlog::level::err = 4, spdlog::level::critical = 5, spdlog::level::off = 6, spdlog::level::n_levels
}
 
enum  spdlog::color_mode { spdlog::color_mode::always, spdlog::color_mode::automatic, spdlog::color_mode::never }
 
enum  spdlog::pattern_time_type { spdlog::pattern_time_type::local, spdlog::pattern_time_type::utc }
 

Functions

const SPDLOG_INLINE string_view_t & spdlog::level::to_string_view (spdlog::level::level_enum l) SPDLOG_NOEXCEPT
 
const SPDLOG_INLINE char * spdlog::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)
 
template<typename T , typename U , enable_if_t<!std::is_same< T, U >::value, int > = 0>
constexpr T spdlog::details::conditional_static_cast (U value)
 

Macro Definition Documentation

◆ SPDLOG_ACTIVE_LEVEL

#define SPDLOG_ACTIVE_LEVEL   SPDLOG_LEVEL_INFO

◆ SPDLOG_API

#define SPDLOG_API

◆ SPDLOG_CATCH_STD

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

◆ SPDLOG_CONSTEXPR

#define SPDLOG_CONSTEXPR   constexpr

◆ SPDLOG_CONSTEXPR_FUNC

#define SPDLOG_CONSTEXPR_FUNC

◆ SPDLOG_DEPRECATED

#define SPDLOG_DEPRECATED

◆ SPDLOG_FILENAME_T

#define SPDLOG_FILENAME_T (   s)    s

◆ SPDLOG_FMT_RUNTIME

#define SPDLOG_FMT_RUNTIME (   format_string)    format_string

◆ SPDLOG_FUNCTION

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

◆ SPDLOG_HEADER_ONLY

#define SPDLOG_HEADER_ONLY

◆ SPDLOG_INLINE

#define SPDLOG_INLINE   inline

◆ SPDLOG_LEVEL_CRITICAL

#define SPDLOG_LEVEL_CRITICAL   5

◆ SPDLOG_LEVEL_DEBUG

#define SPDLOG_LEVEL_DEBUG   1

◆ SPDLOG_LEVEL_ERROR

#define SPDLOG_LEVEL_ERROR   4

◆ SPDLOG_LEVEL_INFO

#define SPDLOG_LEVEL_INFO   2

◆ SPDLOG_LEVEL_NAME_CRITICAL

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

◆ SPDLOG_LEVEL_NAME_DEBUG

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

◆ SPDLOG_LEVEL_NAME_ERROR

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

◆ SPDLOG_LEVEL_NAME_INFO

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

◆ SPDLOG_LEVEL_NAME_OFF

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

◆ SPDLOG_LEVEL_NAME_TRACE

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

◆ SPDLOG_LEVEL_NAME_WARNING

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

◆ SPDLOG_LEVEL_NAMES

#define SPDLOG_LEVEL_NAMES
Value:

◆ SPDLOG_LEVEL_OFF

#define SPDLOG_LEVEL_OFF   6

◆ SPDLOG_LEVEL_TRACE

#define SPDLOG_LEVEL_TRACE   0

◆ SPDLOG_LEVEL_WARN

#define SPDLOG_LEVEL_WARN   3

◆ SPDLOG_NOEXCEPT

#define SPDLOG_NOEXCEPT   noexcept

◆ SPDLOG_SHORT_LEVEL_NAMES

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

◆ SPDLOG_THROW

#define SPDLOG_THROW (   ex)    throw(ex)

◆ SPDLOG_TRY

#define SPDLOG_TRY   try
SPDLOG_LEVEL_NAME_OFF
#define SPDLOG_LEVEL_NAME_OFF
Definition: common.h:229
SPDLOG_LEVEL_NAME_INFO
#define SPDLOG_LEVEL_NAME_INFO
Definition: common.h:225
SPDLOG_LEVEL_NAME_ERROR
#define SPDLOG_LEVEL_NAME_ERROR
Definition: common.h:227
SPDLOG_LEVEL_NAME_WARNING
#define SPDLOG_LEVEL_NAME_WARNING
Definition: common.h:226
SPDLOG_LEVEL_NAME_DEBUG
#define SPDLOG_LEVEL_NAME_DEBUG
Definition: common.h:224