Skip to content
Diana edited this page Oct 2, 2017 · 26 revisions

Functions under the spdlog:: namespace

The functions under spdlog:: are thread safe, except for the following that should not be called if loggers in other threads might execute in same time:

void spdlog::set_pattern(const std::string&);
void spdlog::set_formatter(formatter_ptr);
void spdlog::set_error_handler(log_err_handler);

Loggers

Logger objects are thread safe except for the following methods (should not be called concurrently on same instance):

void spdlog::logger::set_pattern(const std::string&);
void spdlog::logger::set_formatter(formatter_ptr);
void spdlog::logger::set_error_handler(log_err_handler);

Sinks

  • Thread safe sinks: sinks ending with _mt (e.g daily_file_sink_mt)
  • Non thread safe sinks: sinks ending with _st (e.g daily_file_sink_st)