mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-14 01:32:07 +08:00
clang format
This commit is contained in:
parent
eacd4d6b2a
commit
62534f2e4e
@ -15,8 +15,8 @@
|
||||
// formatted data, and support for different format per sink.
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
#include <iterator>
|
||||
#include <vector>
|
||||
|
||||
#include "./common.h"
|
||||
#include "./details/log_msg.h"
|
||||
|
@ -15,9 +15,9 @@
|
||||
|
||||
#include "../details/fmt_helper.h"
|
||||
#include "../details/null_mutex.h"
|
||||
#include "../details/os.h"
|
||||
#include "../details/synchronous_factory.h"
|
||||
#include "./base_sink.h"
|
||||
#include "../details/os.h"
|
||||
|
||||
#if !defined(SPDLOG_ANDROID_RETRIES)
|
||||
#define SPDLOG_ANDROID_RETRIES 2
|
||||
|
@ -29,8 +29,8 @@ struct daily_filename_calculator {
|
||||
static filename_t calc_filename(const filename_t &filename, const tm &now_tm) {
|
||||
filename_t basename, ext;
|
||||
std::tie(basename, ext) = details::file_helper::split_by_extension(filename);
|
||||
return fmt_lib::format(SPDLOG_FMT_STRING(SPDLOG_FILENAME_T("{}_{:04d}-{:02d}-{:02d}{}")), basename, now_tm.tm_year + 1900, now_tm.tm_mon + 1,
|
||||
now_tm.tm_mday, ext);
|
||||
return fmt_lib::format(SPDLOG_FMT_STRING(SPDLOG_FILENAME_T("{}_{:04d}-{:02d}-{:02d}{}")), basename, now_tm.tm_year + 1900,
|
||||
now_tm.tm_mon + 1, now_tm.tm_mday, ext);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -6,10 +6,10 @@
|
||||
#include <spdlog/details/null_mutex.h>
|
||||
#include <spdlog/details/synchronous_factory.h>
|
||||
#include <spdlog/sinks/base_sink.h>
|
||||
#include <syslog.h>
|
||||
|
||||
#include <array>
|
||||
#include <string>
|
||||
#include <syslog.h>
|
||||
|
||||
namespace spdlog {
|
||||
namespace sinks {
|
||||
@ -88,8 +88,8 @@ inline std::shared_ptr<logger> syslog_logger_mt(const std::string &logger_name,
|
||||
int syslog_option = 0,
|
||||
int syslog_facility = LOG_USER,
|
||||
bool enable_formatting = false) {
|
||||
return Factory::template create<sinks::syslog_sink_mt>(logger_name, syslog_ident, syslog_option,
|
||||
syslog_facility, enable_formatting);
|
||||
return Factory::template create<sinks::syslog_sink_mt>(logger_name, syslog_ident, syslog_option, syslog_facility,
|
||||
enable_formatting);
|
||||
}
|
||||
|
||||
template <typename Factory = spdlog::synchronous_factory>
|
||||
@ -98,7 +98,7 @@ inline std::shared_ptr<logger> syslog_logger_st(const std::string &logger_name,
|
||||
int syslog_option = 0,
|
||||
int syslog_facility = LOG_USER,
|
||||
bool enable_formatting = false) {
|
||||
return Factory::template create<sinks::syslog_sink_st>(logger_name, syslog_ident, syslog_option,
|
||||
syslog_facility, enable_formatting);
|
||||
return Factory::template create<sinks::syslog_sink_st>(logger_name, syslog_ident, syslog_option, syslog_facility,
|
||||
enable_formatting);
|
||||
}
|
||||
} // namespace spdlog
|
||||
|
@ -207,8 +207,7 @@ inline void critical(std::string_view msg) { log(level::critical, msg); }
|
||||
#define SPDLOG_LOGGER_CALL(logger, level, ...) \
|
||||
(logger)->log(spdlog::source_loc{__FILE__, __LINE__, SPDLOG_FUNCTION}, level, __VA_ARGS__)
|
||||
#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
|
||||
|
||||
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_TRACE
|
||||
|
@ -78,8 +78,8 @@ TEST_CASE("dir_name", "[create_dir]") {
|
||||
//
|
||||
// test windows cases when drive letter is given e.g. C:\\some-folder
|
||||
//
|
||||
#include <windows.h>
|
||||
#include <fileapi.h>
|
||||
#include <windows.h>
|
||||
|
||||
std::string get_full_path(const std::string &relative_folder_path) {
|
||||
char full_path[MAX_PATH];
|
||||
@ -130,6 +130,5 @@ TEST_CASE("non_existing_drive", "[create_dir]") {
|
||||
REQUIRE(create_dir(path) == false);
|
||||
path += SPDLOG_FILENAME_T("subdir");
|
||||
REQUIRE(create_dir(path) == false);
|
||||
|
||||
}
|
||||
#endif // _WIN32
|
||||
|
@ -10,9 +10,9 @@
|
||||
#include <thread>
|
||||
|
||||
#include "spdlog/details/null_mutex.h"
|
||||
#include "spdlog/details/os.h"
|
||||
#include "spdlog/fmt/fmt.h"
|
||||
#include "spdlog/sinks/base_sink.h"
|
||||
#include "spdlog/details/os.h"
|
||||
|
||||
namespace spdlog {
|
||||
namespace sinks {
|
||||
|
Loading…
Reference in New Issue
Block a user