Commit 2de924a1 authored by gabime's avatar gabime

clang-format

parent c1c2ff2d
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
// Upon destruction, logs all remaining messages in the queue before // Upon destruction, logs all remaining messages in the queue before
// destructing.. // destructing..
#include "spdlog/logger.h" #include "spdlog/logger.h"
namespace spdlog { namespace spdlog {
...@@ -69,5 +68,3 @@ private: ...@@ -69,5 +68,3 @@ private:
#ifdef SPDLOG_HEADER_ONLY #ifdef SPDLOG_HEADER_ONLY
#include "spdlog/impl/async_logger.cpp" #include "spdlog/impl/async_logger.cpp"
#endif // SPDLOG_HEADER_ONLY #endif // SPDLOG_HEADER_ONLY
...@@ -70,7 +70,6 @@ ...@@ -70,7 +70,6 @@
#define SPDLOG_FUNCTION __FUNCTION__ #define SPDLOG_FUNCTION __FUNCTION__
#endif #endif
namespace spdlog { namespace spdlog {
class formatter; class formatter;
......
...@@ -24,17 +24,17 @@ public: ...@@ -24,17 +24,17 @@ public:
file_helper(const file_helper &) = delete; file_helper(const file_helper &) = delete;
file_helper &operator=(const file_helper &) = delete; file_helper &operator=(const file_helper &) = delete;
~file_helper(); ~file_helper();
void open(const filename_t &fname, bool truncate = false); void open(const filename_t &fname, bool truncate = false);
void reopen(bool truncate); void reopen(bool truncate);
void flush(); void flush();
void close(); void close();
void write(const fmt::memory_buffer &buf); void write(const fmt::memory_buffer &buf);
size_t size() const; size_t size() const;
const filename_t &filename() const; const filename_t &filename() const;
static bool file_exists(const filename_t &fname); static bool file_exists(const filename_t &fname);
// //
// return file path and its extension: // return file path and its extension:
// //
...@@ -57,6 +57,6 @@ private: ...@@ -57,6 +57,6 @@ private:
} // namespace details } // namespace details
} // namespace spdlog } // namespace spdlog
#ifdef SPDLOG_HEADER_ONLY #ifdef SPDLOG_HEADER_ONLY
#include "spdlog/impl/file_helper.cpp" #include "spdlog/impl/file_helper.cpp"
#endif // ! SPDLOG_HEADER_ONLY #endif // ! SPDLOG_HEADER_ONLY
...@@ -13,7 +13,7 @@ namespace details { ...@@ -13,7 +13,7 @@ namespace details {
struct log_msg struct log_msg
{ {
log_msg(source_loc loc, const std::string *loggers_name, level::level_enum lvl, string_view_t view); log_msg(source_loc loc, const std::string *loggers_name, level::level_enum lvl, string_view_t view);
log_msg(const std::string *loggers_name, level::level_enum lvl, string_view_t view); log_msg(const std::string *loggers_name, level::level_enum lvl, string_view_t view);
log_msg(const log_msg &other) = default; log_msg(const log_msg &other) = default;
...@@ -33,6 +33,6 @@ struct log_msg ...@@ -33,6 +33,6 @@ struct log_msg
} // namespace details } // namespace details
} // namespace spdlog } // namespace spdlog
#ifdef SPDLOG_HEADER_ONLY #ifdef SPDLOG_HEADER_ONLY
#include "spdlog/impl/log_msg.cpp" #include "spdlog/impl/log_msg.cpp"
#endif // SPDLOG_HEADER_ONLY #endif // SPDLOG_HEADER_ONLY
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
namespace spdlog { namespace spdlog {
namespace details { namespace details {
// padding information. // padding information.
struct padding_info struct padding_info
{ {
...@@ -61,26 +60,22 @@ protected: ...@@ -61,26 +60,22 @@ protected:
padding_info padinfo_; padding_info padinfo_;
}; };
} } // namespace details
class pattern_formatter final : public formatter class pattern_formatter final : public formatter
{ {
public: public:
explicit pattern_formatter( explicit pattern_formatter(
std::string pattern, std::string pattern, pattern_time_type time_type = pattern_time_type::local, std::string eol = spdlog::details::os::default_eol);
pattern_time_type time_type = pattern_time_type::local,
std::string eol = spdlog::details::os::default_eol);
// use default pattern is not given // use default pattern is not given
explicit pattern_formatter( explicit pattern_formatter(pattern_time_type time_type = pattern_time_type::local, std::string eol = spdlog::details::os::default_eol);
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(const pattern_formatter &other) = delete;
pattern_formatter &operator=(const pattern_formatter &other) = delete; pattern_formatter &operator=(const pattern_formatter &other) = delete;
std::unique_ptr<formatter> clone() const override; std::unique_ptr<formatter> clone() const override;
void format(const details::log_msg &msg, fmt::memory_buffer &dest) override; void format(const details::log_msg &msg, fmt::memory_buffer &dest) override;
private: private:
std::string pattern_; std::string pattern_;
...@@ -89,15 +84,15 @@ private: ...@@ -89,15 +84,15 @@ private:
std::tm cached_tm_; std::tm cached_tm_;
std::chrono::seconds last_log_secs_; std::chrono::seconds last_log_secs_;
std::vector<std::unique_ptr<details::flag_formatter>> formatters_; std::vector<std::unique_ptr<details::flag_formatter>> formatters_;
std::tm get_time_(const details::log_msg &msg); std::tm get_time_(const details::log_msg &msg);
void handle_flag_(char flag, details::padding_info padding); void handle_flag_(char flag, details::padding_info padding);
// Extract given pad spec (e.g. %8X) // Extract given pad spec (e.g. %8X)
// Advance the given it pass the end of the padding spec found (if any) // Advance the given it pass the end of the padding spec found (if any)
// Return padding. // Return padding.
details::padding_info handle_padspec_(std::string::const_iterator &it, std::string::const_iterator end); details::padding_info handle_padspec_(std::string::const_iterator &it, std::string::const_iterator end);
void compile_pattern_(const std::string &pattern); void compile_pattern_(const std::string &pattern);
}; };
} // namespace spdlog } // namespace spdlog
......
...@@ -32,59 +32,59 @@ public: ...@@ -32,59 +32,59 @@ public:
registry(const registry &) = delete; registry(const registry &) = delete;
registry &operator=(const registry &) = delete; registry &operator=(const registry &) = delete;
void register_logger(std::shared_ptr<logger> new_logger); void register_logger(std::shared_ptr<logger> new_logger);
void initialize_logger(std::shared_ptr<logger> new_logger); void initialize_logger(std::shared_ptr<logger> new_logger);
std::shared_ptr<logger> get(const std::string &logger_name); std::shared_ptr<logger> get(const std::string &logger_name);
std::shared_ptr<logger> default_logger(); std::shared_ptr<logger> default_logger();
// Return raw ptr to the default logger. // Return raw ptr to the default logger.
// To be used directly by the spdlog default api (e.g. spdlog::info) // To be used directly by the spdlog default api (e.g. spdlog::info)
// This make the default API faster, but cannot be used concurrently with set_default_logger(). // This make the default API faster, but cannot be used concurrently with set_default_logger().
// e.g do not call set_default_logger() from one thread while calling spdlog::info() from another. // e.g do not call set_default_logger() from one thread while calling spdlog::info() from another.
logger *get_default_raw(); logger *get_default_raw();
// set default logger. // set default logger.
// default logger is stored in default_logger_ (for faster retrieval) and in the loggers_ map. // default logger is stored in default_logger_ (for faster retrieval) and in the loggers_ map.
void set_default_logger(std::shared_ptr<logger> new_default_logger); void set_default_logger(std::shared_ptr<logger> new_default_logger);
void set_tp(std::shared_ptr<thread_pool> tp); void set_tp(std::shared_ptr<thread_pool> tp);
std::shared_ptr<thread_pool> get_tp(); std::shared_ptr<thread_pool> get_tp();
// Set global formatter. Each sink in each logger will get a clone of this object // Set global formatter. Each sink in each logger will get a clone of this object
void set_formatter(std::unique_ptr<formatter> formatter); void set_formatter(std::unique_ptr<formatter> formatter);
void set_level(level::level_enum log_level); void set_level(level::level_enum log_level);
void flush_on(level::level_enum log_level); void flush_on(level::level_enum log_level);
void flush_every(std::chrono::seconds interval); void flush_every(std::chrono::seconds interval);
void set_error_handler(void (*handler)(const std::string &msg)); void set_error_handler(void (*handler)(const std::string &msg));
void apply_all(const std::function<void(const std::shared_ptr<logger>)> &fun); void apply_all(const std::function<void(const std::shared_ptr<logger>)> &fun);
void flush_all(); void flush_all();
void drop(const std::string &logger_name); void drop(const std::string &logger_name);
void drop_all(); void drop_all();
// clean all resources and threads started by the registry // clean all resources and threads started by the registry
void shutdown(); void shutdown();
std::recursive_mutex &tp_mutex();
std::recursive_mutex &tp_mutex();
void set_automatic_registration(bool automatic_regsistration); void set_automatic_registration(bool automatic_regsistration);
static registry &instance(); static registry &instance();
private: private:
registry(); registry();
~registry() = default; ~registry() = default;
void throw_if_exists_(const std::string &logger_name); void throw_if_exists_(const std::string &logger_name);
void register_logger_(std::shared_ptr<logger> new_logger); void register_logger_(std::shared_ptr<logger> new_logger);
std::mutex logger_map_mutex_, flusher_mutex_; std::mutex logger_map_mutex_, flusher_mutex_;
std::recursive_mutex tp_mutex_; std::recursive_mutex tp_mutex_;
std::unordered_map<std::string, std::shared_ptr<logger>> loggers_; std::unordered_map<std::string, std::shared_ptr<logger>> loggers_;
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
#include "spdlog/async_logger.h" #include "spdlog/async_logger.h"
#endif #endif
// async logger implementation // async logger implementation
// uses a thread pool to perform the actual logging // uses a thread pool to perform the actual logging
...@@ -15,22 +14,22 @@ ...@@ -15,22 +14,22 @@
template<typename It> template<typename It>
SPDLOG_INLINE spdlog::async_logger::async_logger( SPDLOG_INLINE spdlog::async_logger::async_logger(
std::string logger_name, It begin, It end, std::weak_ptr<details::thread_pool> tp, async_overflow_policy overflow_policy) std::string logger_name, It begin, It end, std::weak_ptr<details::thread_pool> tp, async_overflow_policy overflow_policy)
: logger(std::move(logger_name), begin, end) : logger(std::move(logger_name), begin, end)
, thread_pool_(std::move(tp)) , thread_pool_(std::move(tp))
, overflow_policy_(overflow_policy) , overflow_policy_(overflow_policy)
{ {
} }
SPDLOG_INLINE spdlog::async_logger::async_logger( SPDLOG_INLINE spdlog::async_logger::async_logger(
std::string logger_name, sinks_init_list sinks_list, std::weak_ptr<details::thread_pool> tp, async_overflow_policy overflow_policy) std::string logger_name, sinks_init_list sinks_list, std::weak_ptr<details::thread_pool> tp, async_overflow_policy overflow_policy)
: async_logger(std::move(logger_name), sinks_list.begin(), sinks_list.end(), std::move(tp), overflow_policy) : async_logger(std::move(logger_name), sinks_list.begin(), sinks_list.end(), std::move(tp), overflow_policy)
{ {
} }
SPDLOG_INLINE spdlog::async_logger::async_logger( SPDLOG_INLINE spdlog::async_logger::async_logger(
std::string logger_name, sink_ptr single_sink, std::weak_ptr<details::thread_pool> tp, async_overflow_policy overflow_policy) std::string logger_name, sink_ptr single_sink, std::weak_ptr<details::thread_pool> tp, async_overflow_policy overflow_policy)
: async_logger(std::move(logger_name), {std::move(single_sink)}, std::move(tp), overflow_policy) : async_logger(std::move(logger_name), {std::move(single_sink)}, std::move(tp), overflow_policy)
{ {
} }
...@@ -118,6 +117,3 @@ SPDLOG_INLINE std::shared_ptr<spdlog::logger> spdlog::async_logger::clone(std::s ...@@ -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_); cloned->set_error_handler(this->custom_err_handler_);
return std::move(cloned); return std::move(cloned);
} }
...@@ -17,116 +17,115 @@ ...@@ -17,116 +17,115 @@
#include <tuple> #include <tuple>
namespace spdlog { namespace spdlog {
namespace details namespace details {
SPDLOG_INLINE file_helper::~file_helper()
{ {
SPDLOG_INLINE file_helper::~file_helper() close();
{ }
close();
}
SPDLOG_INLINE void file_helper::open(const filename_t &fname, bool truncate) SPDLOG_INLINE void file_helper::open(const filename_t &fname, bool truncate)
{
close();
auto *mode = truncate ? SPDLOG_FILENAME_T("wb") : SPDLOG_FILENAME_T("ab");
_filename = fname;
for (int tries = 0; tries < open_tries; ++tries)
{ {
close(); if (!os::fopen_s(&fd_, fname, mode))
auto *mode = truncate ? SPDLOG_FILENAME_T("wb") : SPDLOG_FILENAME_T("ab");
_filename = fname;
for (int tries = 0; tries < open_tries; ++tries)
{ {
if (!os::fopen_s(&fd_, fname, mode)) return;
{
return;
}
details::os::sleep_for_millis(open_interval);
} }
throw spdlog_ex("Failed opening file " + os::filename_to_str(_filename) + " for writing", errno); details::os::sleep_for_millis(open_interval);
} }
SPDLOG_INLINE void file_helper::reopen(bool truncate) throw spdlog_ex("Failed opening file " + os::filename_to_str(_filename) + " for writing", errno);
{ }
if (_filename.empty())
{
throw spdlog_ex("Failed re opening file - was not opened before");
}
open(_filename, truncate);
}
SPDLOG_INLINE void file_helper::flush() SPDLOG_INLINE void file_helper::reopen(bool truncate)
{
if (_filename.empty())
{ {
std::fflush(fd_); throw spdlog_ex("Failed re opening file - was not opened before");
} }
open(_filename, truncate);
}
SPDLOG_INLINE void file_helper::close() SPDLOG_INLINE void file_helper::flush()
{ {
if (fd_ != nullptr) std::fflush(fd_);
{ }
std::fclose(fd_);
fd_ = nullptr;
}
}
SPDLOG_INLINE void file_helper::write(const fmt::memory_buffer &buf) SPDLOG_INLINE void file_helper::close()
{
if (fd_ != nullptr)
{ {
size_t msg_size = buf.size(); std::fclose(fd_);
auto data = buf.data(); fd_ = nullptr;
if (std::fwrite(data, 1, msg_size, fd_) != msg_size)
{
throw spdlog_ex("Failed writing to file " + os::filename_to_str(_filename), errno);
}
} }
}
SPDLOG_INLINE size_t file_helper::size() const SPDLOG_INLINE void file_helper::write(const fmt::memory_buffer &buf)
{
size_t msg_size = buf.size();
auto data = buf.data();
if (std::fwrite(data, 1, msg_size, fd_) != msg_size)
{ {
if (fd_ == nullptr) throw spdlog_ex("Failed writing to file " + os::filename_to_str(_filename), errno);
{
throw spdlog_ex("Cannot use size() on closed file " + os::filename_to_str(_filename));
}
return os::filesize(fd_);
} }
}
SPDLOG_INLINE const filename_t &file_helper::filename() const SPDLOG_INLINE size_t file_helper::size() const
{
if (fd_ == nullptr)
{ {
return _filename; throw spdlog_ex("Cannot use size() on closed file " + os::filename_to_str(_filename));
} }
return os::filesize(fd_);
}
SPDLOG_INLINE bool file_helper::file_exists(const filename_t &fname) SPDLOG_INLINE const filename_t &file_helper::filename() const
{ {
return os::file_exists(fname); return _filename;
} }
// SPDLOG_INLINE bool file_helper::file_exists(const filename_t &fname)
// return file path and its extension: {
// return os::file_exists(fname);
// "mylog.txt" => ("mylog", ".txt") }
// "mylog" => ("mylog", "")
// "mylog." => ("mylog.", "")
// "/dir1/dir2/mylog.txt" => ("/dir1/dir2/mylog", ".txt")
//
// the starting dot in filenames is ignored (hidden files):
//
// ".mylog" => (".mylog". "")
// "my_folder/.mylog" => ("my_folder/.mylog", "")
// "my_folder/.mylog.txt" => ("my_folder/.mylog", ".txt")
SPDLOG_INLINE std::tuple<filename_t, filename_t> file_helper::split_by_extension(const filename_t &fname)
{
auto ext_index = fname.rfind('.');
// no valid extension found - return whole path and empty string as //
// extension // return file path and its extension:
if (ext_index == filename_t::npos || ext_index == 0 || ext_index == fname.size() - 1) //
{ // "mylog.txt" => ("mylog", ".txt")
return std::make_tuple(fname, filename_t()); // "mylog" => ("mylog", "")
} // "mylog." => ("mylog.", "")
// "/dir1/dir2/mylog.txt" => ("/dir1/dir2/mylog", ".txt")
//
// the starting dot in filenames is ignored (hidden files):
//
// ".mylog" => (".mylog". "")
// "my_folder/.mylog" => ("my_folder/.mylog", "")
// "my_folder/.mylog.txt" => ("my_folder/.mylog", ".txt")
SPDLOG_INLINE std::tuple<filename_t, filename_t> file_helper::split_by_extension(const filename_t &fname)
{
auto ext_index = fname.rfind('.');
// treat casese like "/etc/rc.d/somelogfile or "/abc/.hiddenfile" // no valid extension found - return whole path and empty string as
auto folder_index = fname.rfind(details::os::folder_sep); // extension
if (folder_index != filename_t::npos && folder_index >= ext_index - 1) if (ext_index == filename_t::npos || ext_index == 0 || ext_index == fname.size() - 1)
{ {
return std::make_tuple(fname, filename_t()); return std::make_tuple(fname, filename_t());
} }
// finally - return a valid base and extension tuple // treat casese like "/etc/rc.d/somelogfile or "/abc/.hiddenfile"
return std::make_tuple(fname.substr(0, ext_index), fname.substr(ext_index)); auto folder_index = fname.rfind(details::os::folder_sep);
if (folder_index != filename_t::npos && folder_index >= ext_index - 1)
{
return std::make_tuple(fname, filename_t());
} }
// finally - return a valid base and extension tuple
return std::make_tuple(fname.substr(0, ext_index), fname.substr(ext_index));
}
} // namespace details } // namespace details
} // namespace spdlog } // namespace spdlog
#include "spdlog/details/os.h" #include "spdlog/details/os.h"
#include "spdlog/sinks/sink.h" #include "spdlog/sinks/sink.h"
#ifndef SPDLOG_HEADER_ONLY #ifndef SPDLOG_HEADER_ONLY
#include "spdlog/details/log_msg.h" #include "spdlog/details/log_msg.h"
#endif #endif
SPDLOG_INLINE spdlog::details::log_msg::log_msg( 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) spdlog::source_loc loc, const std::string *loggers_name, spdlog::level::level_enum lvl, spdlog::string_view_t view)
: logger_name(loggers_name) : logger_name(loggers_name)
......
...@@ -160,11 +160,11 @@ SPDLOG_INLINE bool spdlog::logger::should_flush_(const spdlog::details::log_msg ...@@ -160,11 +160,11 @@ SPDLOG_INLINE bool spdlog::logger::should_flush_(const spdlog::details::log_msg
} }
SPDLOG_INLINE void spdlog::logger::err_handler_(const std::string &msg) SPDLOG_INLINE void spdlog::logger::err_handler_(const std::string &msg)
{ {
if (custom_err_handler_) if (custom_err_handler_)
{ {
custom_err_handler_(msg); custom_err_handler_(msg);
} }
else else
{ {
auto tm_time = spdlog::details::os::localtime(); auto tm_time = spdlog::details::os::localtime();
......
This diff is collapsed.
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include "spdlog/details/registry.h" #include "spdlog/details/registry.h"
#endif #endif
#include "spdlog/common.h" #include "spdlog/common.h"
#include "spdlog/details/periodic_worker.h" #include "spdlog/details/periodic_worker.h"
#include "spdlog/logger.h" #include "spdlog/logger.h"
......
#include "spdlog/common.h" #include "spdlog/common.h"
#include "spdlog/details/pattern_formatter.h" #include "spdlog/details/pattern_formatter.h"
#ifndef SPDLOG_HEADER_ONLY #ifndef SPDLOG_HEADER_ONLY
#include "spdlog/sinks/sink.h" #include "spdlog/sinks/sink.h"
#endif #endif
SPDLOG_INLINE spdlog::sinks::sink::sink() SPDLOG_INLINE spdlog::sinks::sink::sink()
: formatter_{details::make_unique<spdlog::pattern_formatter>()} : 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 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 }
{
return msg_level >= level_.load(std::memory_order_relaxed); SPDLOG_INLINE bool spdlog::sinks::sink::should_log(spdlog::level::level_enum msg_level) const
} {
return msg_level >= level_.load(std::memory_order_relaxed);
SPDLOG_INLINE void spdlog::sinks::sink::set_level(level::level_enum log_level) }
{
level_.store(log_level); SPDLOG_INLINE void spdlog::sinks::sink::set_level(level::level_enum log_level)
} {
level_.store(log_level);
SPDLOG_INLINE spdlog::level::level_enum spdlog::sinks::sink::level() const }
{
return static_cast<spdlog::level::level_enum>(level_.load(std::memory_order_relaxed)); SPDLOG_INLINE spdlog::level::level_enum spdlog::sinks::sink::level() const
} {
return static_cast<spdlog::level::level_enum>(level_.load(std::memory_order_relaxed));
}
This diff is collapsed.
...@@ -17,7 +17,7 @@ class sink ...@@ -17,7 +17,7 @@ class sink
public: public:
sink(); sink();
explicit sink(std::unique_ptr<spdlog::formatter> formatter); explicit sink(std::unique_ptr<spdlog::formatter> formatter);
virtual ~sink() = default; virtual ~sink() = default;
virtual void log(const details::log_msg &msg) = 0; virtual void log(const details::log_msg &msg) = 0;
virtual void flush() = 0; virtual void flush() = 0;
...@@ -25,9 +25,9 @@ public: ...@@ -25,9 +25,9 @@ public:
virtual void set_formatter(std::unique_ptr<spdlog::formatter> sink_formatter) = 0; virtual void set_formatter(std::unique_ptr<spdlog::formatter> sink_formatter) = 0;
bool should_log(level::level_enum msg_level) const; bool should_log(level::level_enum msg_level) const;
void set_level(level::level_enum log_level); void set_level(level::level_enum log_level);
level::level_enum level() const; level::level_enum level() const;
protected: protected:
......
...@@ -328,7 +328,8 @@ inline void critical(const wchar_t *fmt, const Args &... args) ...@@ -328,7 +328,8 @@ inline void critical(const wchar_t *fmt, const Args &... args)
// //
#define SPDLOG_LOGGER_CALL(logger, level, ...) \ #define SPDLOG_LOGGER_CALL(logger, level, ...) \
do { \ do \
{ \
if (logger->should_log(level)) \ if (logger->should_log(level)) \
logger->log(spdlog::source_loc{SPDLOG_FILE_BASENAME(__FILE__), __LINE__, SPDLOG_FUNCTION}, level, __VA_ARGS__); \ logger->log(spdlog::source_loc{SPDLOG_FILE_BASENAME(__FILE__), __LINE__, SPDLOG_FUNCTION}, level, __VA_ARGS__); \
} while (0) } while (0)
......
...@@ -107,7 +107,7 @@ TEST_CASE("clone-logger", "[clone]") ...@@ -107,7 +107,7 @@ TEST_CASE("clone-logger", "[clone]")
cloned->info("Some message 2"); cloned->info("Some message 2");
auto test_sink = std::static_pointer_cast<sinks::test_sink_mt>(cloned->sinks()[0]); auto test_sink = std::static_pointer_cast<sinks::test_sink_mt>(cloned->sinks()[0]);
spdlog::drop_all(); spdlog::drop_all();
} }
...@@ -128,7 +128,7 @@ TEST_CASE("clone async", "[clone]") ...@@ -128,7 +128,7 @@ TEST_CASE("clone async", "[clone]")
spdlog::details::os::sleep_for_millis(10); spdlog::details::os::sleep_for_millis(10);
auto test_sink = std::static_pointer_cast<sinks::test_sink_mt>(cloned->sinks()[0]); auto test_sink = std::static_pointer_cast<sinks::test_sink_mt>(cloned->sinks()[0]);
spdlog::drop_all(); spdlog::drop_all();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment