-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem adding file sync after spdlog has been setup... #3313
Comments
Also NOTE that... I tried adding the following statement to the log configuration, after the log file sink has been added to the "main" logger...
When I do that, NO log text ends up going to either the console or the log file. |
Please submit code showing how And, from |
The shared pointers (m_mainLogger, m_consoleSink, m_fileSink) are all defined in a global class, that exists for the life of the program. Logging statements are issued as follows: As mentioned, this works fine at logging to the console (m_mainLogger / m_consoleSink), but the error statements don't end up in the log file. |
NOTE: This issue has been happening on a spdlog build in Windows x64. I have not yet tried it in my Linux x64 build. |
|
I tried that. It didn't help.
Russ B
…________________________________
From: tt4g ***@***.***>
Sent: Wednesday, January 8, 2025 4:04:18 AM
To: gabime/spdlog ***@***.***>
Cc: Russ B ***@***.***>; Author ***@***.***>
Subject: Re: [gabime/spdlog] Problem adding file sync after spdlog has been setup... (Issue #3313)
SPDLOG_ERROR always uses the default logger.
It will not work unless set to the default logger by spdlog::set_default_logger(m_mainLogger).
See also: https://github.com/gabime/spdlog/wiki/0.-FAQ#how-to-remove-all-debug-statements-at-compile-time-
—
Reply to this email directly, view it on GitHub<#3313 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAER3MU7FN3I6CJ6WEA2TCT2JUH4FAVCNFSM6AAAAABUYSYUG2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNZXGUYDONJQGY>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
If you are running an application on a Windows machine, the OS will discard to buffered data (not written to a file) if the process exits without flushing the log. |
I am working on a new project where I am trying to use speedlog. I have used it in the past and it seemed to work fine.
In the new project, I am creating an initial logging configuration where I create a "main" logger,, and I add a console log sink (see below).
That seems to work fine, and I can see (colored) log output to the console.
However, after the application configuration is loaded, I then try to add a file sink to the "main" logger (see below).
I can then see that the log file is opened, but I never see any log text in the log file.
Is there an issue adding additional log sinks once the initial logging configuration has been setup?
The text was updated successfully, but these errors were encountered: