log message arguments not merged as expected by Python's standard log interface
Closed this issue · 1 comments
According to the official documentation for Python's logging module, the interface for logging should be as follows:
logging.debug(msg, *args, **kwargs)
Logs a message with level DEBUG on the root logger. The msg is the message format string, and the args are the arguments which are merged into msg using the string formatting operator.
Here's an example:
import logging
log = logging.getLogger(__name__)
log.error("This is my error: %s", 123)
One would expect the logged message to be "This is my error: 123."
Pybrake, however, does not respect this interface. The logged message is "This is my error: %s". The "args" are not merged into "msg" as per the standard interface.
After reviewing the source code, I'm fairly certain the problem is here:
Line 57 in 9693af1
This should be changed to
message=record.getMessage()
Using the standard library's getMessage() method.
Thanks for the report and analysis - should be fixed in master branch.