-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
None
-
None
-
None
Hi
The python logging module "mdclogpy" does not respect the standard python logging interface
mdc_logger.debug("Pre-send summary: %s, Post-send summary: %s", pre_send_summary, post_send_summary)
TypeError: debug() takes 2 positional arguments but 4 were given
Python example:
>>> logger = logging.Logger(_name_) >>> a = "asdf" >>> logger.debug("%s", a)
Pylint will complain if you use string formatting for logging because %s is preferred because it does some kind of lazy evaluation. If you make the above code
logger.debug("foo {}".format(a))
Pylint will complain:
logging-format-interpolation: Use % formatting in logging functions and pass the % parameters as arguments
Relevant python docs: https://docs.python.org/3/howto/logging.html#optimization
To note, the reason I raise this is not to nitpick, but because for a python application to transition to this library, if the python app uses proper logs with % already (like A1), all those code statements blow up after dropping in mdclogger.