mirror of
https://github.com/QuasarApp/LIEF.git
synced 2025-05-02 07:09:34 +00:00
Log improvements
This commit is contained in:
parent
1364f22c78
commit
a35a97aa83
@ -51,6 +51,7 @@ using std::chrono::milliseconds;
|
|||||||
namespace LIEF {
|
namespace LIEF {
|
||||||
namespace logging {
|
namespace logging {
|
||||||
|
|
||||||
|
// TODO(romain): Update when moving to C++17
|
||||||
class Logger {
|
class Logger {
|
||||||
public:
|
public:
|
||||||
Logger(const Logger&) = delete;
|
Logger(const Logger&) = delete;
|
||||||
@ -69,8 +70,10 @@ class Logger {
|
|||||||
|
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
static void trace(const char *fmt, const Args &... args) {
|
static void trace(const char *fmt, const Args &... args) {
|
||||||
|
if /* constexpr */ (lief_logging_support and lief_logging_debug) {
|
||||||
Logger::instance().sink_->trace(fmt, args...);
|
Logger::instance().sink_->trace(fmt, args...);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
static void debug(const char *fmt, const Args &... args) {
|
static void debug(const char *fmt, const Args &... args) {
|
||||||
@ -107,7 +110,7 @@ class Logger {
|
|||||||
Logger& operator=(Logger&&);
|
Logger& operator=(Logger&&);
|
||||||
|
|
||||||
static void destroy(void);
|
static void destroy(void);
|
||||||
static Logger* instance_;
|
/* inline */ static Logger* instance_;
|
||||||
std::shared_ptr<spdlog::logger> sink_;
|
std::shared_ptr<spdlog::logger> sink_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user