Re: String concatenation vs. string formatting
- From: Thorsten Kampe <thorsten@xxxxxxxxxxxxxxxx>
- Date: Sat, 9 Jul 2011 06:23:42 +0200
* 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
.
- References:
- String concatenation vs. string formatting
- From: Andrew Berg
- Re: String concatenation vs. string formatting
- From: John Gordon
- String concatenation vs. string formatting
- Prev by Date: Re: meaning of numpy.fft coefficients
- Next by Date: Re: CI and BDD with Python
- Previous by thread: Re: String concatenation vs. string formatting
- Next by thread: Re: String concatenation vs. string formatting
- Index(es):