-
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
Make source_loc more resilient to invalid data #3073
Comments
It appears to be the same problem #2867 |
Although both of these problems apply to Qt, I would not call them the same. In #2867 is a suggestion to make |
This is my personal opinion, If Nevertheless, changing the condition of spdlog/include/spdlog/common.h Line 322 in a2b4262
|
I use spdlog as a logging system for the C++/QML application. The C++ part uses built-in macros for logging:
SPDLOG_*
. For QML part I redirect standard Qt logger via qInstallMessageHandler functionBut different invalid values come from different parts of QML code:
context.line
can be equal-1
context.function
can be equalnullptr
, whilecontext.file
is non-empty stringSo as a result, I added workaround to my code:
After that everything works fine, no more crashes. But would it be possible to add these checks to the SPDLOG to simplify the integration of other projects?
My suggestions:
nullptr
checks forfilename
andfuncname
so there are no crashesThe text was updated successfully, but these errors were encountered: