71 const std::vector<std::string>& args);
73template<
typename... Args>
74void log(
LEVEL level,
const std::string& 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(
const std::string& msg) {
93inline void debug(
const std::string& fmt,
const std::vector<std::string>& args) {
97template<
typename... Args>
98void debug(
const std::string& 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(
const std::string& msg) {
111inline void info(
const std::string& fmt,
const std::vector<std::string>& args) {
115template<
typename... Args>
116void info(
const std::string& 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(
const std::string& msg) {
129inline void warn(
const std::string& fmt,
const std::vector<std::string>& args) {
133template<
typename... Args>
134void warn(
const std::string& 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(
const std::string& msg) {
147inline void err(
const std::string& fmt,
const std::vector<std::string>& args) {
151template<
typename... Args>
152void err(
const std::string& 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);
166 const std::vector<std::string>& args) {
170template<
typename... Args>
171void critical(
const std::string& 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,
const std::string& msg) {
215inline void info(
const char* name,
const std::string& msg) {
219inline void warn(
const char* name,
const std::string& msg) {
223inline void err(
const char* name,
const std::string& msg) {
227inline void critical(
const char* name,
const std::string& 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
const Scoped & set_level(LEVEL lvl) const
Definition logging.hpp:252
Scoped & operator=(const Scoped &)=delete
Scoped(LEVEL level, std::string name)
Definition logging.hpp:246
Definition logging.hpp:179
void warn(const char *name, const std::string &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 debug(const char *name, const std::string &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.
void err(const char *name, const std::string &msg)
Definition logging.hpp:223
void critical(const char *name, const std::string &msg)
Definition logging.hpp:227
spdlog::logger & get_sink(const char *name)
void info(const char *name, const std::string &msg)
Definition logging.hpp:215
void log(const char *name, LEVEL level, const std::string &msg)
Log a message with the logger whose name is provided in the first parameter.
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
LEVEL get_level()
Current log level.
LEVEL
Hierarchical logging level
Definition logging.hpp:39
@ TRACE
Definition logging.hpp:42
@ WARN
Definition logging.hpp:45
@ INFO
Definition logging.hpp:44
@ OFF
Definition logging.hpp:40
@ CRITICAL
Definition logging.hpp:47
@ ERR
Definition logging.hpp:46
@ DEBUG
Definition logging.hpp:43
void warn(const std::string &msg)
Definition logging.hpp:125
void set_path(const std::string &path)
Change the logger to a file-based logging and set its path.
void critical(const std::string &msg)
Definition logging.hpp:161
void err(const std::string &msg)
Definition logging.hpp:143
void enable()
Globally enable the logging module.
void set_logger(std::shared_ptr< spdlog::logger > logger)
void disable()
Globally disable the logging module.
void info(const std::string &msg)
Definition logging.hpp:107
void log(LEVEL level, const std::string &msg)
Log a message with the LIEF's logger.
void set_level(LEVEL level)
Change the logging level (hierarchical).
const char * to_string(LEVEL e)
void debug(const std::string &msg)
Definition logging.hpp:89
void enable_debug()
Definition logging.hpp:85
LIEF namespace.
Definition Abstract/Binary.hpp:40
Definition logging.hpp:26
#define LIEF_API
Definition visibility.h:45