After https://github.com/rotki/rotki/pull/2911 we removed the LogAnonymizing adapter's functionality but kept it as an empty adapter since it's used in many places and its use is what actually allows keyword arguments.
Keyword arguments, while useful, along with fstrings share the same problem. That the arguments are evaluated even if logging is disabled and not emitted.
The way to handle this correctly is to log using the method showcased here.
Additionally as per the log optimization docs we can also add an logger.isEnabledFor(logging.DEBUG) call before each big logging call if passing the arguments themselves ends up being expensive.
Task
Remove all keyword argument log calls
Remove the unused adapter
Make sure logging is done with lazy interpolation
Perhaps use the isEnabledFor() construct in some places
Test all the above by enabling the logging-format-interpolation pylint checker.
Abstract
After https://github.com/rotki/rotki/pull/2911 we removed the LogAnonymizing adapter's functionality but kept it as an empty adapter since it's used in many places and its use is what actually allows keyword arguments.
Keyword arguments, while useful, along with fstrings share the same problem. That the arguments are evaluated even if logging is disabled and not emitted.
The way to handle this correctly is to log using the method showcased here.
Additionally as per the log optimization docs we can also add an
logger.isEnabledFor(logging.DEBUG)
call before each big logging call if passing the arguments themselves ends up being expensive.Task
isEnabledFor()
construct in some placeslogging-format-interpolation
pylint checker.