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
Lazy log message formatting #1001
Comments
Are we just trying to do lazy formatting on the messages sent from the Python side? |
We can do both, in C++ and Python. The C++ We could add that C++ (which controls the loglevel) notifies Python of the current level, so messages are not even transported C++ if the message is not important enough. |
I added a possible approach section above, with the main idea to create a backend for our C++ logger for the python |
Yes, except that we have to call |
Addresses SFTtech#1001
Addresses SFTtech#1001
Addresses SFTtech#1001
Addresses SFTtech#1001
Addresses SFTtech#1001
Addresses SFTtech#1001
C++ side was done in #1029. |
Python side in #1025. |
🎉 |
Our logging system does not support lazy message formatting, like the python
logging
module.The functions are in
openage/log/__init__.py
and then relay the messages tolibopenage
.The formatting of messages should thus happen (either in C++ or the python part, not sure) only if the log level of the message is higher than the minimum log level of a sink that gets the message.
Possible approach:
logging
module so it logs to our C++ as backendlogging
module about log levels from C++logging
module then, our functions can be aliases, or we just only uselogging
all over the python codebase.This is an optimization, so no real priority 😉
The text was updated successfully, but these errors were encountered: