I have multiple loggers writing into a file in async mode.
There is a logger that is always writing on the file, i think only when shutting down / flush the log.
here a sample of logs:
[2023-09-02 10:40:04.949| 27228][ * APP. debug] Application is…
I am using the spdlog library in a C++20 project using modules.
I've encapsulated spdlog inside my singleton logger class because I don't want spdlog exposed to clients in case I swap it out for a different log library someday. But now I want a…
I am trying to encapsulate the header-only spdlog logging library in a C++20 module that keeps the spdlog library internal to the module. The Logger class is a Meyers-style singleton which I thought would be straightforward but is giving me a lot of…
I am trying to statically link my program with spdlog.
I have built spdlog from source using the Debug configuration, and I have specifically cleared the "Runtime Library" setting to avoid any CRT incompatibilities with my project.
However, when I…
I'm desperately trying to understand how cmake works. I inherited a project that uses cmake, and needs spdlog, but I simply cannot make cmake be able to generate the makefiles, because I cannot produce a working Findspdlog.cmake for find_package to…
I have asked on thread, but seems no good solutions. And I know limitations of current way. But, I wanna try once more here.
Please note I'm using spdlog for logging.
I meet a problem when I logging to qt widget QTextEdit with different…
I’m using spdlog library in my high-load service. Also my service is getting requests from another service by gRPC.
At this moment I can’t use streaming gRPC, and every call creates its own connection. As I know I can’t restrict threads count gRPC…
The below program crashes due to a seg fault. I don't find a reason for this. All I know at the moment is that the two calls to info() member spdlog::get( "basic_logger" )->info( "\nLogging started..." ); and spdlog::get( "basic_logger" )->info(…
I have a fairly basic singleton logger class that wraps around spdlog, and that I intend to use throughout my code via the macros defined to log to files. The problem I am having is that I cannot get it to log to files. If I use the…
I am currently implementing a library where I use spdlog for logging. In order to disable logging in Release mode the following can be implemented:
#if !defined(NDEBUG)
LOG(...) Logger::log(__VA_ARGS__)
#else
#define LOG(...) (void)0
#endif
So if…
This may be a stupid, obvious typing question that I'm just overlooking a simple explanation for, so apologies. While using spdlog, the examples are ALL declared in functions, in my case like this:
void daily_example()
{ auto daily_logger =…
Update: I finally could solve this problem on my own after (see below [#Solution]) this post getting automaticaly flagged as CLOSED & some further hours of digging the web & some helpful comments - Huge thanks! This post solved the issue.
I'm…
How should I print the time when opening and closing a log file?
Here:
#include
#include
#include
int main( )
{
spdlog::file_event_handlers handlers;
handlers.after_open =…
I want to import spdlog in my project using CMake. And I use VS Code.
But my code doesn't work well. I think I don't have any problem in my code because I copy and paste all professor's code.
I think that it is simple setting error, but I don't know…
How can I format the output of SPDLOG macro calls to exclude [main.cpp:9] parts?
#include
int main()
{
SPDLOG_DEBUG("SMTH1");
SPDLOG_TRACE("SMTH2");
SPDLOG_INFO("SMTH3");
}
default output:
[2022-11-11 21:07:28.346]…