71 const std::vector<std::string>& args);
73template<
typename... Args>
74void log(
Level level, std::string_view fmt,
const Args&... args) {
75 std::vector<std::string> vec_args;
76 vec_args.insert(vec_args.end(),
77 {static_cast<decltype(vec_args)::value_type>(args)...});
78 return log(level, fmt, vec_args);
89inline void debug(std::string_view msg) {
93inline void debug(std::string_view fmt,
const std::vector<std::string>& args) {
97template<
typename... Args>
98void debug(std::string_view fmt,
const Args&... args) {
99 std::vector<std::string> vec_args;
100 vec_args.insert(vec_args.end(),
101 {static_cast<decltype(vec_args)::value_type>(args)...});
102 return debug(fmt, vec_args);
107inline void info(std::string_view msg) {
111inline void info(std::string_view fmt,
const std::vector<std::string>& args) {
115template<
typename... Args>
116void info(std::string_view fmt,
const Args&... args) {
117 std::vector<std::string> vec_args;
118 vec_args.insert(vec_args.end(),
119 {static_cast<decltype(vec_args)::value_type>(args)...});
120 return info(fmt, vec_args);
125inline void warn(std::string_view msg) {
129inline void warn(std::string_view fmt,
const std::vector<std::string>& args) {
133template<
typename... Args>
134void warn(std::string_view fmt,
const Args&... args) {
135 std::vector<std::string> vec_args;
136 vec_args.insert(vec_args.end(),
137 {static_cast<decltype(vec_args)::value_type>(args)...});
138 return warn(fmt, vec_args);
143inline void err(std::string_view msg) {
147inline void err(std::string_view fmt,
const std::vector<std::string>& args) {
151template<
typename... Args>
152void err(std::string_view fmt,
const Args&... args) {
153 std::vector<std::string> vec_args;
154 vec_args.insert(vec_args.end(),
155 {static_cast<decltype(vec_args)::value_type>(args)...});
156 return err(fmt, vec_args);
165inline void critical(std::string_view fmt,
const std::vector<std::string>& args) {
169template<
typename... Args>
170void critical(std::string_view fmt,
const Args&... args) {
171 std::vector<std::string> vec_args;
172 vec_args.insert(vec_args.end(),
173 {static_cast<decltype(vec_args)::value_type>(args)...});
210inline void debug(
const char* name, std::string_view msg) {
214inline void info(
const char* name, std::string_view msg) {
218inline void warn(
const char* name, std::string_view msg) {
222inline void err(
const char* name, std::string_view msg) {
226inline void critical(
const char* name, std::string_view msg) {
247 name_(std::move(name)) {
Scoped(const Scoped &)=delete
Scoped & operator=(Scoped &&)=delete
Scoped(Level level)
Definition logging.hpp:240
~Scoped()
Definition logging.hpp:264
void reset()
Definition logging.hpp:260
Scoped(Level level, std::string name)
Definition logging.hpp:245
const Scoped & set_level(Level lvl) const
Definition logging.hpp:251
Scoped & operator=(const Scoped &)=delete
Definition logging.hpp:178
void info(const char *name, std::string_view msg)
Definition logging.hpp:214
void err(const char *name, std::string_view msg)
Definition logging.hpp:222
void warn(const char *name, std::string_view msg)
Definition logging.hpp:218
void set_level(const char *name, Level level)
Set the log level for the logger with the given name.
void log(const char *name, Level level, std::string_view msg)
Log a message with the logger whose name is provided in the first parameter.
void debug(const char *name, std::string_view msg)
Definition logging.hpp:210
void set_path(const char *name, const std::string &path)
Change the logger with the given name to a file-based logging and set its path.
spdlog::logger & get_sink(const char *name)
void critical(const char *name, std::string_view msg)
Definition logging.hpp:226
void set_logger(const char *name, std::shared_ptr< spdlog::logger > logger)
Set a spdlog sink for the logger with the given name.
Definition logging.hpp:31
void info(std::string_view msg)
Definition logging.hpp:107
void critical(std::string_view msg)
Definition logging.hpp:161
void set_path(const std::string &path)
Change the logger to a file-based logging and set its path.
Level get_level()
Current log level.
Level
Hierarchical logging level
Definition logging.hpp:39
@ Critical
Definition logging.hpp:47
@ Info
Definition logging.hpp:44
@ Warn
Definition logging.hpp:45
@ Debug
Definition logging.hpp:43
@ Err
Definition logging.hpp:46
@ Off
Definition logging.hpp:40
@ Trace
Definition logging.hpp:42
void log(Level level, std::string_view msg)
Log a message with the LIEF's logger.
void enable()
Globally enable the logging module.
void warn(std::string_view msg)
Definition logging.hpp:125
void debug(std::string_view msg)
Definition logging.hpp:89
void set_logger(std::shared_ptr< spdlog::logger > logger)
void disable()
Globally disable the logging module.
const char * to_string(Level e)
void set_level(Level level)
Change the logging level (hierarchical).
void err(std::string_view msg)
Definition logging.hpp:143
void enable_debug()
Definition logging.hpp:85
Definition logging.hpp:26
#define LIEF_API
Definition visibility.h:44