mozilla-services / metlog-py

INACTIVE - http://mzl.la/ghe-archive - Python library for Services metrics logging
36 stars 8 forks source link

Don't apply string formatting if no args were given. #31

Closed rfk closed 12 years ago

rfk commented 12 years ago

Currently if I call client.error(message) with no additional arguments, metlog will apply string formatting to the message. This can cause an error if the message happens to contain a percent symbol or other formatting control char.

This patch copies the approach of the stdlib logging module, where formatting is only done if args were actually provided.