log class : added color output based on log levels (WIP)
This commit is contained in:
parent
04e9366cb8
commit
5a30f0711e
|
@ -157,7 +157,7 @@ void Elf::Open(const std::string& file_name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DebugDump();
|
//DebugDump();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Elf::isSelfFile() const
|
bool Elf::isSelfFile() const
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <spdlog/common.h>
|
#include <spdlog/common.h>
|
||||||
#include <spdlog/sinks/stdout_color_sinks.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;
|
std::vector<spdlog::sink_ptr> sinks;
|
||||||
|
|
||||||
int init(bool use_stdout) {
|
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
|
sinks.clear();//clear existing sinks
|
||||||
if (use_stdout)//if we use stdout window then init it as well
|
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>());
|
sinks.push_back(std::make_shared<spdlog::sinks::stdout_color_sink_mt>());
|
||||||
|
|
Loading…
Reference in New Issue