mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-25 10:01:33 +08:00
clang-format
This commit is contained in:
parent
c1c2ff2d07
commit
2de924a187
@ -19,7 +19,6 @@
|
||||
// Upon destruction, logs all remaining messages in the queue before
|
||||
// destructing..
|
||||
|
||||
|
||||
#include "spdlog/logger.h"
|
||||
|
||||
namespace spdlog {
|
||||
@ -69,5 +68,3 @@ private:
|
||||
#ifdef SPDLOG_HEADER_ONLY
|
||||
#include "spdlog/impl/async_logger.cpp"
|
||||
#endif // SPDLOG_HEADER_ONLY
|
||||
|
||||
|
||||
|
@ -70,7 +70,6 @@
|
||||
#define SPDLOG_FUNCTION __FUNCTION__
|
||||
#endif
|
||||
|
||||
|
||||
namespace spdlog {
|
||||
|
||||
class formatter;
|
||||
|
@ -20,7 +20,6 @@
|
||||
namespace spdlog {
|
||||
namespace details {
|
||||
|
||||
|
||||
// padding information.
|
||||
struct padding_info
|
||||
{
|
||||
@ -61,20 +60,16 @@ protected:
|
||||
padding_info padinfo_;
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace details
|
||||
|
||||
class pattern_formatter final : public formatter
|
||||
{
|
||||
public:
|
||||
explicit pattern_formatter(
|
||||
std::string pattern,
|
||||
pattern_time_type time_type = pattern_time_type::local,
|
||||
std::string eol = spdlog::details::os::default_eol);
|
||||
std::string pattern, pattern_time_type time_type = pattern_time_type::local, std::string eol = spdlog::details::os::default_eol);
|
||||
|
||||
// use default pattern is not given
|
||||
explicit pattern_formatter(
|
||||
pattern_time_type time_type = pattern_time_type::local,
|
||||
std::string eol = spdlog::details::os::default_eol);
|
||||
explicit pattern_formatter(pattern_time_type time_type = pattern_time_type::local, std::string eol = spdlog::details::os::default_eol);
|
||||
|
||||
pattern_formatter(const pattern_formatter &other) = delete;
|
||||
pattern_formatter &operator=(const pattern_formatter &other) = delete;
|
||||
|
@ -2,7 +2,6 @@
|
||||
#include "spdlog/async_logger.h"
|
||||
#endif
|
||||
|
||||
|
||||
// async logger implementation
|
||||
// uses a thread pool to perform the actual logging
|
||||
|
||||
@ -118,6 +117,3 @@ SPDLOG_INLINE std::shared_ptr<spdlog::logger> spdlog::async_logger::clone(std::s
|
||||
cloned->set_error_handler(this->custom_err_handler_);
|
||||
return std::move(cloned);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -17,8 +17,7 @@
|
||||
#include <tuple>
|
||||
|
||||
namespace spdlog {
|
||||
namespace details
|
||||
{
|
||||
namespace details {
|
||||
SPDLOG_INLINE file_helper::~file_helper()
|
||||
{
|
||||
close();
|
||||
|
@ -5,8 +5,6 @@
|
||||
#include "spdlog/details/log_msg.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
SPDLOG_INLINE spdlog::details::log_msg::log_msg(
|
||||
spdlog::source_loc loc, const std::string *loggers_name, spdlog::level::level_enum lvl, spdlog::string_view_t view)
|
||||
: logger_name(loggers_name)
|
||||
|
@ -959,9 +959,7 @@ private:
|
||||
|
||||
} // namespace details
|
||||
|
||||
|
||||
SPDLOG_INLINE pattern_formatter::pattern_formatter(
|
||||
std::string pattern, pattern_time_type time_type, std::string eol)
|
||||
SPDLOG_INLINE pattern_formatter::pattern_formatter(std::string pattern, pattern_time_type time_type, std::string eol)
|
||||
: pattern_(std::move(pattern))
|
||||
, eol_(std::move(eol))
|
||||
, pattern_time_type_(time_type)
|
||||
@ -982,7 +980,6 @@ private:
|
||||
formatters_.push_back(details::make_unique<details::full_formatter>(details::padding_info{}));
|
||||
}
|
||||
|
||||
|
||||
SPDLOG_INLINE std::unique_ptr<formatter> pattern_formatter::clone() const
|
||||
{
|
||||
return details::make_unique<pattern_formatter>(pattern_, pattern_time_type_, eol_);
|
||||
@ -1263,4 +1260,3 @@ private:
|
||||
}
|
||||
}
|
||||
} // namespace spdlog
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include "spdlog/details/registry.h"
|
||||
#endif
|
||||
|
||||
|
||||
#include "spdlog/common.h"
|
||||
#include "spdlog/details/periodic_worker.h"
|
||||
#include "spdlog/logger.h"
|
||||
|
@ -7,11 +7,13 @@
|
||||
|
||||
SPDLOG_INLINE spdlog::sinks::sink::sink()
|
||||
: formatter_{details::make_unique<spdlog::pattern_formatter>()}
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
SPDLOG_INLINE spdlog::sinks::sink::sink(std::unique_ptr<spdlog::formatter> formatter)
|
||||
: formatter_{std::move(formatter)}
|
||||
{}
|
||||
{
|
||||
}
|
||||
|
||||
SPDLOG_INLINE bool spdlog::sinks::sink::should_log(spdlog::level::level_enum msg_level) const
|
||||
{
|
||||
|
@ -124,7 +124,6 @@ public:
|
||||
log(level::critical, fmt, args...);
|
||||
}
|
||||
|
||||
|
||||
template<typename T>
|
||||
void log(level::level_enum lvl, const T &msg)
|
||||
{
|
||||
@ -338,8 +337,6 @@ public:
|
||||
spdlog::level_t level_{spdlog::logger::default_level()};
|
||||
spdlog::level_t flush_level_{level::off};
|
||||
err_handler custom_err_handler_{nullptr};
|
||||
|
||||
|
||||
};
|
||||
} // namespace spdlog
|
||||
|
||||
|
@ -328,7 +328,8 @@ inline void critical(const wchar_t *fmt, const Args &... args)
|
||||
//
|
||||
|
||||
#define SPDLOG_LOGGER_CALL(logger, level, ...) \
|
||||
do { \
|
||||
do \
|
||||
{ \
|
||||
if (logger->should_log(level)) \
|
||||
logger->log(spdlog::source_loc{SPDLOG_FILE_BASENAME(__FILE__), __LINE__, SPDLOG_FUNCTION}, level, __VA_ARGS__); \
|
||||
} while (0)
|
||||
|
Loading…
Reference in New Issue
Block a user