mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 16:35:45 +08:00
clang format
This commit is contained in:
parent
7147da468f
commit
070dd181df
@ -262,13 +262,12 @@ struct my_type
|
|||||||
: i(i){};
|
: i(i){};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Using a namespace alias like fmt_lib is not allowed when extending an existing namespace,
|
// Using a namespace alias like fmt_lib is not allowed when extending an existing namespace,
|
||||||
// but the correct namespace can still be selected with the SPDLOG_USE_STD_FORMAT macro.
|
// but the correct namespace can still be selected with the SPDLOG_USE_STD_FORMAT macro.
|
||||||
#ifdef SPDLOG_USE_STD_FORMAT
|
#ifdef SPDLOG_USE_STD_FORMAT
|
||||||
namespace std {
|
namespace std {
|
||||||
#else
|
#else
|
||||||
namespace fmt {
|
namespace fmt {
|
||||||
#endif
|
#endif
|
||||||
template<>
|
template<>
|
||||||
struct formatter<my_type> : formatter<std::string>
|
struct formatter<my_type> : formatter<std::string>
|
||||||
|
@ -21,7 +21,8 @@ class SPDLOG_API periodic_worker
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
template<typename Rep, typename Period>
|
template<typename Rep, typename Period>
|
||||||
periodic_worker(const std::function<void()> &callback_fun, std::chrono::duration<Rep, Period> interval) {
|
periodic_worker(const std::function<void()> &callback_fun, std::chrono::duration<Rep, Period> interval)
|
||||||
|
{
|
||||||
active_ = (interval > std::chrono::duration<Rep, Period>::zero());
|
active_ = (interval > std::chrono::duration<Rep, Period>::zero());
|
||||||
if (!active_)
|
if (!active_)
|
||||||
{
|
{
|
||||||
|
@ -293,9 +293,10 @@ inline void critical(const T &msg)
|
|||||||
//
|
//
|
||||||
|
|
||||||
#ifndef SPDLOG_NO_SOURCE_LOC
|
#ifndef SPDLOG_NO_SOURCE_LOC
|
||||||
#define SPDLOG_LOGGER_CALL(logger, level, ...) (logger)->log(spdlog::source_loc{__FILE__, __LINE__, SPDLOG_FUNCTION}, level, __VA_ARGS__)
|
# define SPDLOG_LOGGER_CALL(logger, level, ...) \
|
||||||
|
(logger)->log(spdlog::source_loc{__FILE__, __LINE__, SPDLOG_FUNCTION}, level, __VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
#define SPDLOG_LOGGER_CALL(logger, level, ...) (logger)->log(spdlog::source_loc{}, level, __VA_ARGS__)
|
# define SPDLOG_LOGGER_CALL(logger, level, ...) (logger)->log(spdlog::source_loc{}, level, __VA_ARGS__)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_TRACE
|
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_TRACE
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#if defined(__GNUC__) && __GNUC__ == 12
|
||||||
#if defined (__GNUC__) && __GNUC__ == 12
|
# pragma GCC diagnostic push
|
||||||
# pragma GCC diagnostic push
|
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized" // Workaround for GCC 12
|
||||||
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized" // Workaround for GCC 12
|
|
||||||
#endif
|
#endif
|
||||||
#include "catch.hpp"
|
#include "catch.hpp"
|
||||||
#if defined (__GNUC__) && __GNUC__ == 12
|
#if defined(__GNUC__) && __GNUC__ == 12
|
||||||
# pragma GCC diagnostic pop
|
# pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#if defined (__GNUC__) && __GNUC__ == 12
|
#if defined(__GNUC__) && __GNUC__ == 12
|
||||||
# pragma GCC diagnostic push
|
# pragma GCC diagnostic push
|
||||||
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized" // Workaround for GCC 12
|
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized" // Workaround for GCC 12
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CATCH_CONFIG_MAIN
|
#define CATCH_CONFIG_MAIN
|
||||||
#include "catch.hpp"
|
#include "catch.hpp"
|
||||||
|
|
||||||
#if defined (__GNUC__) && __GNUC__ == 12
|
#if defined(__GNUC__) && __GNUC__ == 12
|
||||||
# pragma GCC diagnostic pop
|
# pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user