W1201

Message

Specify string format arguments as logging function parameters

Description

When using python's built-in logging module you shouldn't concatenate strings with values, and instead format the string. As if string.format()

Explanation

Instead of

logging.info('Some information because ' + str(number))

Do it like this:

logging.info('Some information because %d', number)

Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License