From: Christopher Lenz Date: Sun, 29 Jul 2007 20:04:17 +0000 (+0000) Subject: Use proper logging in distutils `compile_catalog` command. X-Git-Tag: 1.0~418 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de05fd89888e8e83a871b746285ed29181594c97;p=thirdparty%2Fbabel.git Use proper logging in distutils `compile_catalog` command. --- diff --git a/babel/messages/frontend.py b/babel/messages/frontend.py index 052a33bc..383c9e5d 100755 --- a/babel/messages/frontend.py +++ b/babel/messages/frontend.py @@ -145,20 +145,20 @@ class compile_catalog(Command): for message in list(catalog)[1:]: if message.string: translated +=1 - print "%d of %d messages (%d%%) translated in %r" % ( - translated, len(catalog), translated * 100 // len(catalog), - po_file - ) + log.info('%d of %d messages (%d%%) translated in %r', + translated, len(catalog), + translated * 100 // len(catalog), po_file) if catalog.fuzzy and not self.use_fuzzy: - print 'catalog %r is marked as fuzzy, skipping' % (po_file) + log.warn('catalog %r is marked as fuzzy, skipping', po_file) continue for message, errors in catalog.check(): for error in errors: - print 'error: %s:%d: %s' % (po_file, message.lineno, error) + log.error('error: %s:%d: %s', po_file, message.lineno, + error) - print 'compiling catalog %r to %r' % (po_file, mo_file) + log.info('compiling catalog %r to %r', po_file, mo_file) outfile = open(mo_file, 'w') try: