1
0
mirror of https://github.com/gabime/spdlog.git synced 2025-04-29 12:03:53 +00:00

Added final keywords to sinks and pattern_formatter.cpp

This commit is contained in:
gabime 2024-05-03 18:30:04 +03:00
parent 4ee50804d3
commit 15829cfb84
8 changed files with 11 additions and 11 deletions

View File

@ -82,13 +82,13 @@ private:
}; };
template <typename Mutex> template <typename Mutex>
class ansicolor_stdout_sink : public ansicolor_sink<Mutex> { class ansicolor_stdout_sink final : public ansicolor_sink<Mutex> {
public: public:
explicit ansicolor_stdout_sink(color_mode mode = color_mode::automatic); explicit ansicolor_stdout_sink(color_mode mode = color_mode::automatic);
}; };
template <typename Mutex> template <typename Mutex>
class ansicolor_stderr_sink : public ansicolor_sink<Mutex> { class ansicolor_stderr_sink final : public ansicolor_sink<Mutex> {
public: public:
explicit ansicolor_stderr_sink(color_mode mode = color_mode::automatic); explicit ansicolor_stderr_sink(color_mode mode = color_mode::automatic);
}; };

View File

@ -19,7 +19,7 @@ namespace sinks {
* MSVC sink (logging using OutputDebugStringA) * MSVC sink (logging using OutputDebugStringA)
*/ */
template <typename Mutex> template <typename Mutex>
class msvc_sink : public base_sink<Mutex> { class msvc_sink final : public base_sink<Mutex> {
public: public:
msvc_sink() = default; msvc_sink() = default;
msvc_sink(bool check_debugger_present) msvc_sink(bool check_debugger_present)

View File

@ -13,7 +13,7 @@ namespace spdlog {
namespace sinks { namespace sinks {
template <typename Mutex> template <typename Mutex>
class null_sink : public base_sink<Mutex> { class null_sink final : public base_sink<Mutex> {
protected: protected:
void sink_it_(const details::log_msg &) override {} void sink_it_(const details::log_msg &) override {}
void flush_() override {} void flush_() override {}

View File

@ -40,13 +40,13 @@ private:
}; };
template <typename Mutex> template <typename Mutex>
class stdout_sink : public stdout_sink_base<Mutex> { class stdout_sink final : public stdout_sink_base<Mutex> {
public: public:
stdout_sink(); stdout_sink();
}; };
template <typename Mutex> template <typename Mutex>
class stderr_sink : public stdout_sink_base<Mutex> { class stderr_sink final : public stdout_sink_base<Mutex> {
public: public:
stderr_sink(); stderr_sink();
}; };

View File

@ -18,7 +18,7 @@ namespace sinks {
* Sink that write to syslog using the `syscall()` library call. * Sink that write to syslog using the `syscall()` library call.
*/ */
template <typename Mutex> template <typename Mutex>
class syslog_sink : public base_sink<Mutex> { class syslog_sink final : public base_sink<Mutex> {
public: public:
syslog_sink(std::string ident, int syslog_option, int syslog_facility, bool enable_formatting) syslog_sink(std::string ident, int syslog_option, int syslog_facility, bool enable_formatting)
: enable_formatting_{enable_formatting}, : enable_formatting_{enable_formatting},

View File

@ -39,7 +39,7 @@ struct tcp_sink_config {
}; };
template <typename Mutex> template <typename Mutex>
class tcp_sink : public spdlog::sinks::base_sink<Mutex> { class tcp_sink final : public spdlog::sinks::base_sink<Mutex> {
public: public:
// connect to tcp host/port or throw if failed // connect to tcp host/port or throw if failed
// host can be hostname or ip address // host can be hostname or ip address

View File

@ -33,7 +33,7 @@ struct udp_sink_config {
}; };
template <typename Mutex> template <typename Mutex>
class udp_sink : public spdlog::sinks::base_sink<Mutex> { class udp_sink final : public spdlog::sinks::base_sink<Mutex> {
public: public:
// host can be hostname or ip address // host can be hostname or ip address
explicit udp_sink(udp_sink_config sink_config) explicit udp_sink(udp_sink_config sink_config)

View File

@ -147,7 +147,7 @@ public:
static std::array<const char *, 7> full_days{{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}}; static std::array<const char *, 7> full_days{{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}};
template <typename ScopedPadder> template <typename ScopedPadder>
class A_formatter : public flag_formatter { class A_formatter final : public flag_formatter {
public: public:
explicit A_formatter(padding_info padinfo) explicit A_formatter(padding_info padinfo)
: flag_formatter(padinfo) {} : flag_formatter(padinfo) {}
@ -741,7 +741,7 @@ private:
// Class for formatting Mapped Diagnostic Context (MDC) in log messages. // Class for formatting Mapped Diagnostic Context (MDC) in log messages.
// Example: [logger-name] [info] [mdc_key_1:mdc_value_1 mdc_key_2:mdc_value_2] some message // Example: [logger-name] [info] [mdc_key_1:mdc_value_1 mdc_key_2:mdc_value_2] some message
template <typename ScopedPadder> template <typename ScopedPadder>
class mdc_formatter : public flag_formatter { class mdc_formatter final : public flag_formatter {
public: public:
explicit mdc_formatter(padding_info padinfo) explicit mdc_formatter(padding_info padinfo)
: flag_formatter(padinfo) {} : flag_formatter(padinfo) {}