diff options
author | dongwenjuan <dong.wenjuan@zte.com.cn> | 2017-08-14 16:58:13 +0800 |
---|---|---|
committer | dongwenjuan <dong.wenjuan@zte.com.cn> | 2017-09-04 22:30:39 +0800 |
commit | 19f7ba75850c52e1ae163766b64b6d153e8d7e1b (patch) | |
tree | f76b13d9d9092209788624609f65872ca8d0dea5 /tests/logger.py | |
parent | 836a8932d6c6a502980009b9578f0c6ecf64cb47 (diff) |
refactor failure inject
JIRA: DOCTOR-116
Change-Id: I14deda4ccb47414cff139a522a9196b68e92500e
Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>
Diffstat (limited to 'tests/logger.py')
-rw-r--r-- | tests/logger.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/logger.py b/tests/logger.py index 80d19bb9..b7a49fdb 100644 --- a/tests/logger.py +++ b/tests/logger.py @@ -21,8 +21,6 @@ class Logger(object): CI_DEBUG = os.getenv('CI_DEBUG') - filename = '%s.log' % logger_name - logging.basicConfig(filemode='w', filename=filename) self.logger = logging.getLogger(logger_name) self.logger.propagate = 0 self.logger.setLevel(logging.DEBUG) @@ -38,7 +36,8 @@ class Logger(object): ch.setLevel(logging.INFO) self.logger.addHandler(ch) - file_handler = logging.FileHandler(filename) + filename = '%s.log' % logger_name + file_handler = logging.FileHandler(filename, mode='w') file_handler.setFormatter(formatter) file_handler.setLevel(logging.DEBUG) self.logger.addHandler(file_handler) |