log class : added color output based on log levels (WIP)

This commit is contained in:
georgemoralis 2023-08-13 17:33:50 +03:00
parent 04e9366cb8
commit 5a30f0711e
2 changed files with 5 additions and 1 deletions

View File

@ -157,7 +157,7 @@ void Elf::Open(const std::string& file_name)
}
}
DebugDump();
//DebugDump();
}
bool Elf::isSelfFile() const

View File

@ -1,6 +1,8 @@
#include <vector>
#include <spdlog/common.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/pattern_formatter.h>
#include <spdlog/spdlog.h>
@ -8,6 +10,8 @@ namespace logging {
std::vector<spdlog::sink_ptr> sinks;
int init(bool use_stdout) {
auto f = std::make_unique<spdlog::pattern_formatter>("%^|%L|: %v%$", spdlog::pattern_time_type::local, std::string("")); // disable eol
spdlog::set_formatter(std::move(f));
sinks.clear();//clear existing sinks
if (use_stdout)//if we use stdout window then init it as well
sinks.push_back(std::make_shared<spdlog::sinks::stdout_color_sink_mt>());