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