Class stdout_sink_base

Synopsis

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

template<typename ConsoleMutex>
class stdout_sink_base : public sink

Description

No description yet.

Inheritance

Ancestors: sink

Decsendents: stdout_sink, stderr_sink

Methods

stdout_sink_base overload
~stdout_sink_base
flush
log
operator= overload
set_formatter
set_pattern

Source

Lines 19-46 in include/spdlog/sinks/stdout_sinks.h.

template<typename ConsoleMutex>
class stdout_sink_base : public sink
{
public:
    using mutex_t = typename ConsoleMutex::mutex_t;
    explicit stdout_sink_base(FILE *file);
    ~stdout_sink_base() override = default;

    stdout_sink_base(const stdout_sink_base &other) = delete;
    stdout_sink_base(stdout_sink_base &&other) = delete;

    stdout_sink_base &operator=(const stdout_sink_base &other) = delete;
    stdout_sink_base &operator=(stdout_sink_base &&other) = delete;

    void log(const details::log_msg &msg) override;
    void flush() override;
    void set_pattern(const std::string &pattern) override;

    void set_formatter(std::unique_ptr<spdlog::formatter> sink_formatter) override;

protected:
    mutex_t &mutex_;
    FILE *file_;
    std::unique_ptr<spdlog::formatter> formatter_;
#ifdef _WIN32
    HANDLE handle_;    
#endif // WIN32
};





Add Discussion

Log in to comment