The following code :
#include "spdlog/spdlog.h"
#include "spdlog/sinks/stdout_color_sinks.h"
int main() {
auto stdout_sink = std::make_shared<spdlog::sinks::stdout_color_sink_mt>();
auto a = std::make_shared<spdlog::logger>("a", stdout_sink);
auto b = std::make_shared<spdlog::logger>("b", stdout_sink);
a->set_pattern("%v");
b->set_pattern("debug %v");
a->info("a");
b->info("b");
}
outputs
debug a
debug b
rather than
a
debug b
It seems as though the spdlogger only remembers the last registered pattern. How do I achieve the intended as in having two loggers with different patterns