String concatenation vs. string formatting
Thorsten Kampe
thorsten at thorstenkampe.de
Sat Jul 9 00:23:42 EDT 2011
More information about the Python-list mailing list
Sat Jul 9 00:23:42 EDT 2011
- Previous message (by thread): String concatenation vs. string formatting
- Next message (by thread): String concatenation vs. string formatting
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
* John Gordon (Fri, 8 Jul 2011 20:23:52 +0000 (UTC))
> I prefer this usage:
>
> logger.error('%s could not be stored - %s' % \
> (self.preset_file, sys.exc_info()[1]))
The syntax for formatting logging messages according to the
documentation is:
Logger.error(msg, *args)
NOT
Logger.error(msg % (*args))
Thorsten
- Previous message (by thread): String concatenation vs. string formatting
- Next message (by thread): String concatenation vs. string formatting
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list