Changeset 391 for python/trunk/Lib/distutils/log.py
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Lib/distutils/log.py
r2 r391 1 1 """A simple log mechanism styled after PEP 282.""" 2 3 # This module should be kept compatible with Python 2.1.4 2 5 3 # The class here is styled after PEP 282 so that it could later be … … 20 18 21 19 def _log(self, level, msg, args): 20 if level not in (DEBUG, INFO, WARN, ERROR, FATAL): 21 raise ValueError('%s wrong log level' % str(level)) 22 22 23 if level >= self.threshold: 23 if notargs:24 # msg may contain a '%'. If args is empty,25 # don't even try to string-format26 print msg24 if args: 25 msg = msg % args 26 if level in (WARN, ERROR, FATAL): 27 stream = sys.stderr 27 28 else: 28 print msg % args 29 sys.stdout.flush() 29 stream = sys.stdout 30 stream.write('%s\n' % msg) 31 stream.flush() 30 32 31 33 def log(self, level, msg, *args):
Note:
See TracChangeset
for help on using the changeset viewer.