Fix an issue with Python 2.7 where regression test output is printed twice by the logger.

This commit is contained in:
Khushboo Vashi
2019-03-20 13:36:37 +00:00
committed by Dave Page
parent 5dd1472d6b
commit b529c28b43

View File

@@ -363,12 +363,13 @@ if __name__ == '__main__':
signal.signal(getattr(signal, sig), sig_handler)
# Set basic logging configuration for log file
logging.basicConfig(
level=logging.DEBUG,
handlers=[logging.FileHandler(CURRENT_PATH + '/' +
'regression.log', 'w', 'utf-8')],
format='%(asctime)s:%(levelname)s:%(name)s:%(message)s',
)
fh = logging.FileHandler(CURRENT_PATH + '/' +
'regression.log', 'w', 'utf-8')
fh.setLevel(logging.DEBUG)
fh.setFormatter(logging.Formatter(config.FILE_LOG_FORMAT))
logger = logging.getLogger()
logger.addHandler(fh)
# Create logger to write log in the logger file as well as on console
stderr_logger = logging.getLogger('STDERR')