I have working logging in Visual studio project using spdlog. I used the same project in Qt creator, then the spdlog logging does not output anything. But the std::cout still works and prints to Qt creator's application output window.
std::vector<spdlog::sink_ptr> sinks;
sinks.push_back(std::make_shared<spdlog::sinks::stdout_color_sink_mt>());
sinks.push_back(std::make_shared<spdlog::sinks::basic_file_sink_mt>("multisink.txt", true));
auto appLogger = std::make_shared<spdlog::logger>("appLogger", begin(sinks), end(sinks));
appLogger->set_level(spdlog::level::debug);
spdlog::register_logger(appLogger);
spdlog::flush_on(spdlog::level::debug);
appLogger->warn("this should appear in both console and file");
Yes, the application output does not output the spdlogs. But, I manage to output to terminal by following steps.
If these steps don't help, you can delete entire build directory and run the steps again.