mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-12 17:00:25 +08:00
Update spdlog.h
Update comments about macros
This commit is contained in:
parent
d39b495e21
commit
9fc0ab31d5
@ -118,20 +118,24 @@ std::shared_ptr<logger> create(const std::string& logger_name, const It& sinks_b
|
||||
template <typename Sink, typename... Args>
|
||||
std::shared_ptr<spdlog::logger> create(const std::string& logger_name, const Args&...);
|
||||
|
||||
|
||||
// Drop the reference to the given logger
|
||||
void drop(const std::string &name);
|
||||
|
||||
// Drop all references
|
||||
void drop_all();
|
||||
|
||||
|
||||
//
|
||||
//
|
||||
// Macros to be display source file & line
|
||||
//
|
||||
// Trace & debug can be switched on/off at compile time for zero cost debug statements.
|
||||
// Trace & Debug can be switched on/off at compile time for zero cost debug statements.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// Enable debug macro, must be defined before including spdlog.h
|
||||
// #define SPDLOG_DEBUG_ON
|
||||
// include "spdlog/spdlog.h"
|
||||
// #define SPDLOG_DEBUG_ON
|
||||
// include "spdlog/spdlog.h"
|
||||
// SPDLOG_DEBUG(my_logger, "Some debug message {} {}", 1, 3.2);
|
||||
//
|
||||
|
||||
#ifdef SPDLOG_TRACE_ON
|
||||
#define SPDLOG_TRACE(logger, ...) logger->trace(__VA_ARGS__) << " (" << __FILE__ << " #" << __LINE__ <<")";
|
||||
#else
|
||||
@ -152,12 +156,6 @@ std::shared_ptr<spdlog::logger> create(const std::string& logger_name, const Arg
|
||||
#define SPDLOG_ALERT(logger, ...) logger->alert(__VA_ARGS__) << " (" << __FILE__ << " #" << __LINE__ <<")";
|
||||
#define SPDLOG_EMERG(logger, ...) logger->emerg(__VA_ARGS__) << " (" << __FILE__ << " #" << __LINE__ <<")";
|
||||
|
||||
// Drop the reference to the given logger
|
||||
void drop(const std::string &name);
|
||||
|
||||
// Drop all references
|
||||
void drop_all();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user