sintonia/python_apps/std_err_override/LogWriter.py
2015-01-05 16:41:03 -05:00

11 lines
220 B
Python
Executable file

import sys
class LogWriter():
def __init__(self, logger):
self.logger = logger
def write(self, txt):
self.logger.error(txt)
def override_std_err(logger):
sys.stderr = LogWriter(logger)