如何格式化SPDLOG宏调用的输出以排除[main.cpp:9]部件?
#include <spdlog/spdlog.h>
int main()
{
SPDLOG_DEBUG("SMTH1");
SPDLOG_TRACE("SMTH2");
SPDLOG_INFO("SMTH3");
}默认输出:
[2022-11-11 21:07:28.346] [temp] [debug] [main.cpp:9] SMTH1
[2022-11-11 21:07:28.348] [trace] [debug] [main.cpp:10] SMTH2
[2022-11-11 21:07:28.349] [info] [debug] [main.cpp:11] SMTH3期望产出:
[2022-11-11 21:07:28.346] [temp] [debug] SMTH1
[2022-11-11 21:07:28.348] [trace] [debug] SMTH2
[2022-11-11 21:07:28.349] [info] [debug] SMTH3发布于 2022-11-11 13:54:45
包含spdlog.h之前的#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_INFO
https://stackoverflow.com/questions/74396563
复制相似问题