Class base_sink

Synopsis

#include <include/spdlog/sinks/base_sink.h>

template<typename Mutex>
class base_sink : public sink

Description

No description yet.

Mentioned in

Inheritance

Ancestors: sink

Decsendents: hourly_file_sink, basic_file_sink, ringbuffer_sink, win_eventlog_sink, syslog_sink, dist_sink, systemd_sink, null_sink, daily_file_sink, tcp_sink, ostream_sink, rotating_file_sink

Methods

base_sink overload
~base_sink
flush
flush_
log
operator= overload
set_formatter
set_formatter_
set_pattern
set_pattern_
sink_it_

Source

Lines 18-46 in include/spdlog/sinks/base_sink.h.

template<typename Mutex>
class base_sink : public sink
{
public:
    base_sink();
    explicit base_sink(std::unique_ptr<spdlog::formatter> formatter);
    ~base_sink() override = default;

    base_sink(const base_sink &) = delete;
    base_sink(base_sink &&) = delete;

    base_sink &operator=(const base_sink &) = delete;
    base_sink &operator=(base_sink &&) = delete;

    void log(const details::log_msg &msg) final;
    void flush() final;
    void set_pattern(const std::string &pattern) final;
    void set_formatter(std::unique_ptr<spdlog::formatter> sink_formatter) final;

protected:
    // sink formatter
    std::unique_ptr<spdlog::formatter> formatter_;
    mutable Mutex mutex_;

    virtual void sink_it_(const details::log_msg &msg) = 0;
    virtual void flush_() = 0;
    virtual void set_pattern_(const std::string &pattern);
    virtual void set_formatter_(std::unique_ptr<spdlog::formatter> sink_formatter);
};





Add Discussion

Log in to comment