You shouldn't construct log messages like this (`.format`), you should instead do `%` and commas. You will waste time for `log.debug("something: %s" % x)` or `log.debug("something: {}".format(x))`, but not for `log.debug("something: %s", x)`. In the latter case, the string formatting will be handled in the method and you won't get the performance hit if it won't be logged. This is because instead of making a format string, we're passing arguments to the logging function. Then, if and only if we actually hit this line of code and log something, does the logging function perform the string substitution. Thus, logging functions should always be in this format.

So this should be, `TASK_LOG.info("Number of items generated by chunking %s not equal to original total %s", num_items_queued, total_num_items)`

See http://stackoverflow.com/questions/4148790/lazy-logger-message-string-evaluation and share around with others - every bit of performance we can save is better :)