72 const std::vector<std::string>& args);
74template<
typename... Args>
75void log(
Level level, std::string_view fmt,
const Args&... args) {
76 std::vector<std::string> vec_args;
77 vec_args.insert(vec_args.end(),
78 {static_cast<decltype(vec_args)::value_type>(args)...});
79 return log(level, fmt, vec_args);
90inline void debug(std::string_view msg) {
94inline void debug(std::string_view fmt,
const std::vector<std::string>& args) {
98template<
typename... Args>
99void debug(std::string_view fmt,
const Args&... args) {
100 std::vector<std::string> vec_args;
101 vec_args.insert(vec_args.end(),
102 {static_cast<decltype(vec_args)::value_type>(args)...});
103 return debug(fmt, vec_args);
108inline void info(std::string_view msg) {
112inline void info(std::string_view fmt,
const std::vector<std::string>& args) {
116template<
typename... Args>
117void info(std::string_view fmt,
const Args&... args) {
118 std::vector<std::string> vec_args;
119 vec_args.insert(vec_args.end(),
120 {static_cast<decltype(vec_args)::value_type>(args)...});
121 return info(fmt, vec_args);
126inline void warn(std::string_view msg) {
130inline void warn(std::string_view fmt,
const std::vector<std::string>& args) {
134template<
typename... Args>
135void warn(std::string_view fmt,
const Args&... args) {
136 std::vector<std::string> vec_args;
137 vec_args.insert(vec_args.end(),
138 {static_cast<decltype(vec_args)::value_type>(args)...});
139 return warn(fmt, vec_args);
144inline void err(std::string_view msg) {
148inline void err(std::string_view fmt,
const std::vector<std::string>& args) {
152template<
typename... Args>
153void err(std::string_view fmt,
const Args&... args) {
154 std::vector<std::string> vec_args;
155 vec_args.insert(vec_args.end(),
156 {static_cast<decltype(vec_args)::value_type>(args)...});
157 return err(fmt, vec_args);
166inline void critical(std::string_view fmt,
const std::vector<std::string>& args) {
170template<
typename... Args>
171void critical(std::string_view fmt,
const Args&... args) {
172 std::vector<std::string> vec_args;
173 vec_args.insert(vec_args.end(),
174 {static_cast<decltype(vec_args)::value_type>(args)...});
211inline void debug(
const char* name, std::string_view msg) {
215inline void info(
const char* name, std::string_view msg) {
219inline void warn(
const char* name, std::string_view msg) {
223inline void err(
const char* name, std::string_view msg) {
227inline void critical(
const char* name, std::string_view msg) {
248 name_(std::move(name)) {
Scoped(const Scoped &)=delete
Scoped & operator=(Scoped &&)=delete
Scoped(Level level)
Definition logging.hpp:241
~Scoped()
Definition logging.hpp:265
void reset()
Definition logging.hpp:261
Scoped(Level level, std::string name)
Definition logging.hpp:246
const Scoped & set_level(Level lvl) const
Definition logging.hpp:252
Scoped & operator=(const Scoped &)=delete
Definition logging.hpp:179
void info(const char *name, std::string_view msg)
Definition logging.hpp:215
void err(const char *name, std::string_view msg)
Definition logging.hpp:223
void warn(const char *name, std::string_view msg)
Definition logging.hpp:219
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:211
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:227
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:32
void info(std::string_view msg)
Definition logging.hpp:108
void critical(std::string_view msg)
Definition logging.hpp:162
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:40
@ Critical
Definition logging.hpp:48
@ Info
Definition logging.hpp:45
@ Warn
Definition logging.hpp:46
@ Debug
Definition logging.hpp:44
@ Err
Definition logging.hpp:47
@ Off
Definition logging.hpp:41
@ Trace
Definition logging.hpp:43
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:126
void debug(std::string_view msg)
Definition logging.hpp:90
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:144
void enable_debug()
Definition logging.hpp:86
Definition logging.hpp:27
#define LIEF_API
Definition visibility.h:45