-
-
Notifications
You must be signed in to change notification settings - Fork 259
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
MmkvLogger creates log strings even if logging is disabled #710
Comments
Guten Tag, Hans here. Note New features, bugfixes, updates and other improvements are all handled mostly by |
Sure it is possible - I'd gladly accept PRs that change/fix this. |
It's an unneeded heap allocation plus the formatting logic added to every command... IMO, a wrapper around a performance-driven library shouldn't be doing that. You don't want to fix it? Your Perhaps you could use preprocessor directives in your cpp Log function... |
I'm no c guru -- but I put my ideas into a PR. Feel free to use some or none of them. It appears NSLog needs to be guarded by preprocessor guard in Release builds if you don't want to log. Android Log probably skips INFO logs on release though I haven't tested. Finally, I also showed putting the preprocessor directive in the shared cpp. I don't know if that works though. |
The string_format method seems like an anti-pattern... Is is possible to move all formatting to platform log implementations, which skip the string format overhead when not in use?
The text was updated successfully, but these errors were encountered: