From 17d63c62c4149179b3aab793ca14ccb9fc8f0427b425ff9d46365939d055d013 Mon Sep 17 00:00:00 2001 From: CupWater Date: Mon, 17 Aug 2026 13:47:07 +0800 Subject: [PATCH] . --- include/featherlog/log_message.hpp | 5 ++--- include/featherlog/log_outputter.hpp | 12 +++++------- include/featherlog/logger.hpp | 16 +++++++--------- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/include/featherlog/log_message.hpp b/include/featherlog/log_message.hpp index 49e0d1b..2959b2e 100644 --- a/include/featherlog/log_message.hpp +++ b/include/featherlog/log_message.hpp @@ -7,8 +7,7 @@ #include -namespace flog -{ +namespace flog { struct LogMessage { std::chrono::system_clock::time_point timestamp; LogLevel level; @@ -17,4 +16,4 @@ namespace flog }; } -#endif \ No newline at end of file +#endif diff --git a/include/featherlog/log_outputter.hpp b/include/featherlog/log_outputter.hpp index d88c621..4fc27ad 100644 --- a/include/featherlog/log_outputter.hpp +++ b/include/featherlog/log_outputter.hpp @@ -7,17 +7,15 @@ #include #include -namespace flog -{ - class FLOG_API LogOutputter - { +namespace flog { + class FLOG_API LogOutputter { public: virtual ~LogOutputter() = default; - std::unique_ptr FLOG_CALL set_formatter(const std::unique_ptr& formatter); - [[nodiscard]] const std::unique_ptr& FLOG_CALL get_formatter() const; + std::unique_ptr FLOG_CALL set_formatter(const std::unique_ptr &formatter); + [[nodiscard]] const std::unique_ptr & FLOG_CALL get_formatter() const; - virtual void FLOG_CALL write(const LogMessage& message) = 0; + virtual void FLOG_CALL write(const LogMessage &message) = 0; protected: std::unique_ptr m_logFormatter; diff --git a/include/featherlog/logger.hpp b/include/featherlog/logger.hpp index 62444fe..8aa9fea 100644 --- a/include/featherlog/logger.hpp +++ b/include/featherlog/logger.hpp @@ -7,24 +7,22 @@ #include -namespace flog -{ +namespace flog { class LoggerManager; - class FLOG_API Logger - { + class FLOG_API Logger { friend class LogManager; public: ~Logger() = default; - template - void FLOG_CALL info(std::format_string fmt, Args&&... args, - std::source_location loc = std::source_location::current()); + template + void FLOG_CALL info(std::format_string fmt, Args &&... args, + std::source_location loc = std::source_location::current()); private: - Logger(std::string name, const std::weak_ptr &manager) noexcept : - m_name(std::move(name)), m_logManager(manager) + Logger(std::string name, const std::weak_ptr &manager) noexcept : m_name(std::move(name)), + m_logManager(manager) { } std::string m_name;