mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-29 01:29:35 +08:00
fix comments grammar
This commit is contained in:
@@ -25,7 +25,7 @@ namespace spdlog {
|
|||||||
using default_factory = synchronous_factory;
|
using default_factory = synchronous_factory;
|
||||||
|
|
||||||
// Create and register a logger with a templated sink type
|
// Create and register a logger with a templated sink type
|
||||||
// The logger's level, formatter and flush level will be set according the
|
// The logger's level, formatter and flush level will be set according to the
|
||||||
// global settings.
|
// global settings.
|
||||||
//
|
//
|
||||||
// Example:
|
// Example:
|
||||||
@@ -46,7 +46,7 @@ inline std::shared_ptr<spdlog::logger> create(std::string logger_name, SinkArgs
|
|||||||
// spdlog::initialize_logger(mylogger);
|
// spdlog::initialize_logger(mylogger);
|
||||||
SPDLOG_API void initialize_logger(std::shared_ptr<logger> logger);
|
SPDLOG_API void initialize_logger(std::shared_ptr<logger> logger);
|
||||||
|
|
||||||
// Return an existing logger or nullptr if a logger with such name doesn't
|
// Return an existing logger or nullptr if a logger with such a name doesn't
|
||||||
// exist.
|
// exist.
|
||||||
// example: spdlog::get("my_logger")->info("hello {}", "world");
|
// example: spdlog::get("my_logger")->info("hello {}", "world");
|
||||||
SPDLOG_API std::shared_ptr<logger> get(const std::string &name);
|
SPDLOG_API std::shared_ptr<logger> get(const std::string &name);
|
||||||
@@ -71,13 +71,13 @@ SPDLOG_API void dump_backtrace();
|
|||||||
// Get global logging level
|
// Get global logging level
|
||||||
SPDLOG_API level::level_enum get_level();
|
SPDLOG_API level::level_enum get_level();
|
||||||
|
|
||||||
// Set global logging level
|
// Set the global logging level
|
||||||
SPDLOG_API void set_level(level::level_enum log_level);
|
SPDLOG_API void set_level(level::level_enum log_level);
|
||||||
|
|
||||||
// Determine whether the default logger should log messages with a certain level
|
// Determine whether the default logger should log messages with a certain level
|
||||||
SPDLOG_API bool should_log(level::level_enum lvl);
|
SPDLOG_API bool should_log(level::level_enum lvl);
|
||||||
|
|
||||||
// Set global flush level
|
// Set a global flush level
|
||||||
SPDLOG_API void flush_on(level::level_enum log_level);
|
SPDLOG_API void flush_on(level::level_enum log_level);
|
||||||
|
|
||||||
// Start/Restart a periodic flusher thread
|
// Start/Restart a periodic flusher thread
|
||||||
@@ -93,7 +93,7 @@ SPDLOG_API void set_error_handler(void (*handler)(const std::string &msg));
|
|||||||
// Register the given logger with the given name
|
// Register the given logger with the given name
|
||||||
SPDLOG_API void register_logger(std::shared_ptr<logger> logger);
|
SPDLOG_API void register_logger(std::shared_ptr<logger> logger);
|
||||||
|
|
||||||
// Apply a user defined function on all registered loggers
|
// Apply a user-defined function on all registered loggers
|
||||||
// Example:
|
// Example:
|
||||||
// spdlog::apply_all([&](std::shared_ptr<spdlog::logger> l) {l->flush();});
|
// spdlog::apply_all([&](std::shared_ptr<spdlog::logger> l) {l->flush();});
|
||||||
SPDLOG_API void apply_all(const std::function<void(std::shared_ptr<logger>)> &fun);
|
SPDLOG_API void apply_all(const std::function<void(std::shared_ptr<logger>)> &fun);
|
||||||
@@ -111,19 +111,19 @@ SPDLOG_API void shutdown();
|
|||||||
SPDLOG_API void set_automatic_registration(bool automatic_registration);
|
SPDLOG_API void set_automatic_registration(bool automatic_registration);
|
||||||
|
|
||||||
// API for using default logger (stdout_color_mt),
|
// API for using default logger (stdout_color_mt),
|
||||||
// e.g: spdlog::info("Message {}", 1);
|
// e.g.: spdlog::info("Message {}", 1);
|
||||||
//
|
//
|
||||||
// The default logger object can be accessed using the spdlog::default_logger():
|
// The default logger object can be accessed using the spdlog::default_logger():
|
||||||
// For example, to add another sink to it:
|
// For example, to add another sink to it:
|
||||||
// spdlog::default_logger()->sinks().push_back(some_sink);
|
// spdlog::default_logger()->sinks().push_back(some_sink);
|
||||||
//
|
//
|
||||||
// The default logger can replaced using spdlog::set_default_logger(new_logger).
|
// The default logger can be replaced using spdlog::set_default_logger(new_logger).
|
||||||
// For example, to replace it with a file logger.
|
// For example, to replace it with a file logger.
|
||||||
//
|
//
|
||||||
// IMPORTANT:
|
// IMPORTANT:
|
||||||
// The default API is thread safe (for _mt loggers), but:
|
// The default API is thread safe (for _mt loggers), but:
|
||||||
// set_default_logger() *should not* be used concurrently with the default API.
|
// set_default_logger() *should not* be used concurrently with the default API.
|
||||||
// e.g do not call set_default_logger() from one thread while calling spdlog::info() from another.
|
// e.g., do not call set_default_logger() from one thread while calling spdlog::info() from another.
|
||||||
|
|
||||||
SPDLOG_API std::shared_ptr<spdlog::logger> default_logger();
|
SPDLOG_API std::shared_ptr<spdlog::logger> default_logger();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user