From 524ca93e915a8a4edeee6fc06931d513749ef775 Mon Sep 17 00:00:00 2001 From: gabime Date: Thu, 15 Jan 2015 13:48:49 +0200 Subject: [PATCH] Comments --- include/spdlog/spdlog.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/include/spdlog/spdlog.h b/include/spdlog/spdlog.h index d99501b0..497a6f49 100644 --- a/include/spdlog/spdlog.h +++ b/include/spdlog/spdlog.h @@ -47,29 +47,31 @@ namespace spdlog // logger.info() << "This is another message" << x << y << z; std::shared_ptr get(const std::string& name); - - // // Set global formatting -// e.g. spdlog::set_pattern("%Y-%m-%d %H:%M:%S.%e %l : %v"); +// example: spdlog::set_pattern("%Y-%m-%d %H:%M:%S.%e %l : %v"); // void set_pattern(const std::string& format_string); void set_formatter(formatter_ptr f); // -// Set global logging level +// Set global logging level for // void set_level(level::level_enum log_level); - +// // Turn on async mode (off by default) and set the queue size for each async_logger. // effective only for loggers created after this call. // queue_size: size of queue (must be power of 2): -// Each logger will pre-allocate a dedicated queue with queue_size entries upon construction. -// async_overflow_policy (optional): -// async_overflow_policy::block_retry (default policy, if queue is full, block until queue has room for the new log entry) -// async_overflow_policy::discard_log_msg (never block and discard any new messages when queue overflows) -// worker_warmup_cb(optional): callback function that will be called in worker thread upon start (can be used to init stuff like thread affinity) +// Each logger will pre-allocate a dedicated queue with queue_size entries upon construction. +// +// async_overflow_policy (optional, block_retry by default): +// async_overflow_policy::block_retry - if queue is full, block until queue has room for the new log entry. +// async_overflow_policy::discard_log_msg - never block and discard any new messages when queue overflows. +// +// worker_warmup_cb (optional): +// callback function that will be called in worker thread upon start (can be used to init stuff like thread affinity) +// void set_async_mode(size_t queue_size, const async_overflow_policy overflow_policy = async_overflow_policy::block_retry, const std::function& worker_warmup_cb = nullptr); // Turn off async mode @@ -104,11 +106,9 @@ std::shared_ptr stderr_logger_st(const std::string& logger_name); std::shared_ptr syslog_logger(const std::string& logger_name, const std::string& ident = "", int syslog_option = 0); #endif -// -// Create a logger with multiple sinks -// -std::shared_ptr create(const std::string& logger_name, sinks_init_list sinks); +// Create a logger with multiple sinks +std::shared_ptr create(const std::string& logger_name, sinks_init_list sinks); template std::shared_ptr create(const std::string& logger_name, const It& sinks_begin, const It& sinks_end); @@ -147,11 +147,11 @@ std::shared_ptr create(const std::string& logger_name, const Arg // Drop the reference to the given logger void drop(const std::string &name); + // Drop all references void drop_all(); } - #include "details/spdlog_impl.h"