class
SushiDSP::Logger
Formats log calls and hands each line at or above the minimum level to one sink.
- Declared in
include/SushiDSP/log/Logger.hpp
Never call it from the audio thread; see include/SushiDSP/README.md.
Public member functions
Logger(std::shared_ptr< ILogSink > sink, LogLevel minimum_level) noexceptStarts with a sink and a minimum level.
Parameters
sinkMust not be null.
Logger(const Logger &)=deleteLogger & operator=(const Logger &)=deleteLogger(Logger &&)=deleteLogger & operator=(Logger &&)=delete~Logger()=defaultstd::shared_ptr< ILogSink > set_sink(std::shared_ptr< ILogSink > sink) noexceptReplaces the sink; lines already handed to the old one stay with it.
Parameters
sinkMust not be null.
Returns
The sink that was in place.
void set_minimum_level(LogLevel level) noexceptSets the level below which lines are discarded at run time.
LogLevel minimum_level() const noexceptReturns the level below which lines are discarded at run time.
bool is_enabled(LogLevel level) const noexceptReports whether a line of this level would reach the sink.
template <typename... Values>
void log(LogLevel level, const LogCategory &category, std::string_view format, const Values &... values) noexceptFormats a message on the stack and writes it when its level is enabled.
Parameters
formatPositional
{}markers only; see LogFormatter.hpp.
void write(const LogRecord &record) noexceptHands a formatted line to the sink whatever its level, and flushes after a Fatal.
void flush() noexceptReturns once the sink has put every earlier line at its destination.

