Closed xudooo closed 2 months ago
Logging macros such as SPDLOG_LOGGER_INFO
working for you.
See wiki: https://github.com/gabime/spdlog/wiki/0.-FAQ#source-information-do-not-appear-when-using-custom-format
- another_logger()->info("Hi, I am another logger");
+ std::shared_ptr<spdlog::logger> another = another_logger();
+ SPDLOG_LOGGER_INFO(another, "Hi, I am another logger");
BTW: latest version is 1.14.1, version 2 not released.
Thanks, that worked for me. BTW, I was seeing the version in version.h as 2.0.0: but that doesn't matter, anyway thanks!
Maybe using master branch, current working branch is v1.x.
I'm a beginner and I'm wondering why the default logger prints the information about function name and line number, while the customized logger doesn't. How should I set it up to be able to print this information? Thanks.
code
result
[2024-07-29 11:33:02.433] [test] [438187] [info] [main.cpp:68:main] right aligned, left aligned [2024-07-29 11:33:02.433] [another] [438187] [info] [::] Hi, I am another logger
version
2.0.0