-
Notifications
You must be signed in to change notification settings - Fork 120
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
Format string is hard-coded to be a string literal #27
Comments
Currently only literal format string is supported, you can wrap the log statements using macros simply as |
Yes, that's what I ended up doing - I split You may want to document in README.md that only string literals are supported for formats. This will make it more clear that for applications that would need to wrap the logger in their own layer it won't work without patching. Closing this issue, since you consider this working as designed. I will update my v2.1.1 patch at some point for those who's interested in this path. |
Implemented the change mentioned above, which allows format in |
Please check latest update, now FMT_STRING is removed and the format string type is the same as fmt::format/print. |
Thanks. I merged my changes with the new code. Here's the branch with all changes, if you want to consider any of it. |
If the format string is not a string literal, cryptic compiler messages are reported and at first it's not even clear what the problem is. For example:
GCC reports
use of parameter from containing function
against theformat
parameter and an additional error'constexpr' call flows off the end of the function
incore.h
infmt
. VC++ reports justfunction cannot access 'fmt'
.This is caused by
FMT_STRING
used in all logging macros, which only works with string literals. RemovingFMT_STRING
from logging macros fixes these errors.The text was updated successfully, but these errors were encountered: