This is how i would use it:
logging.debug(u'subject: %s', subject)
In your case subject
seems to be unicode. So the format should also be unicode.
When you do 'subject: '+subject
, if one of the operands is unicode, the other is converted to unicode automatically.
Pay attention that i did debug(u'subject: %s', subject)
instead of debug(u'subject: %s' % subject)
- so the string is formatted only when logger is actually emitting a record.