[New-bugs-announce] [issue22195] Make it easy to replace print() calls with logging calls

Antoine Pitrou report at bugs.python.org
Thu Aug 14 17:18:00 CEST 2014


New submission from Antoine Pitrou:

Often an application (or e.g. a library's test suite), in its early development, will start making print() calls, and later will want to switch to the logging module. However the logging module doesn't offer any facility for this: you can't print() to a logger object, and loggers don't have a method that reflects print()'s signature.

(note print() only uses the .write() and .flush() methods on its stream argument, so a simple wrapper may make the trick)

----------
components: Library (Lib)
messages: 225302
nosy: pitrou, vinay.sajip
priority: normal
severity: normal
status: open
title: Make it easy to replace print() calls with logging calls
type: enhancement
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22195>
_______________________________________


More information about the New-bugs-announce mailing list