diff options
| author | Jesse Noller <jnoller@gmail.com> | 2009-01-18 21:04:36 (GMT) |
|---|---|---|
| committer | Jesse Noller <jnoller@gmail.com> | 2009-01-18 21:04:36 (GMT) |
| commit | 438195fc113bf50a01343f5d1fba52448f696647 (patch) | |
| tree | 91116ca7e66f2759d8199502ec3d385c549e653e /Lib/multiprocessing/util.py | |
| parent | fe11f4d524bb08b81a145d19ee023131c80b08e8 (diff) | |
| download | cpython-438195fc113bf50a01343f5d1fba52448f696647.zip cpython-438195fc113bf50a01343f5d1fba52448f696647.tar.gz cpython-438195fc113bf50a01343f5d1fba52448f696647.tar.bz2 | |
issue 4301: patch logging to add processName, remove the old _check_logger_class code
Diffstat (limited to 'Lib/multiprocessing/util.py')
| -rw-r--r-- | Lib/multiprocessing/util.py | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/Lib/multiprocessing/util.py b/Lib/multiprocessing/util.py index 7d53512..2e7a2ac 100644 --- a/Lib/multiprocessing/util.py +++ b/Lib/multiprocessing/util.py @@ -69,34 +69,10 @@ def get_logger(): atexit._exithandlers.remove((_exit_function, (), {})) atexit._exithandlers.append((_exit_function, (), {})) - _check_logger_class() _logger = logging.getLogger(LOGGER_NAME) return _logger -def _check_logger_class(): - ''' - Make sure process name is recorded when loggers are used - ''' - # XXX This function is unnecessary once logging is patched - import logging - if hasattr(logging, 'multiprocessing'): - return - - logging._acquireLock() - try: - OldLoggerClass = logging.getLoggerClass() - if not getattr(OldLoggerClass, '_process_aware', False): - class ProcessAwareLogger(OldLoggerClass): - _process_aware = True - def makeRecord(self, *args, **kwds): - record = OldLoggerClass.makeRecord(self, *args, **kwds) - record.processName = current_process()._name - return record - logging.setLoggerClass(ProcessAwareLogger) - finally: - logging._releaseLock() - def log_to_stderr(level=None): ''' Turn on logging and add a handler which prints to stderr |
