Commit bab596a2 authored by Stephen Thompson's avatar Stephen Thompson

Issue #3 added method to release log file

parent c44e89f3
Pipeline #4446 failed with stages
in 6 minutes
......@@ -50,3 +50,10 @@ class Logger():
return
self._logger.info(message)
def close(self):
"""Releases the log file"""
if self._no_logging:
return
self._logger.handlers[0].close()
......@@ -18,6 +18,7 @@ def test_empty_config():
logger = Logger(config)
logger.log(message="testing")
logger.close()
def test_non_empty_config():
"""
......@@ -32,6 +33,8 @@ def test_non_empty_config():
logger.log(message="testing")
assert path.exists("sks_evaluation.log")
logger.close()
remove("sks_evaluation.log")
def test_overwrite():
......@@ -45,6 +48,8 @@ def test_overwrite():
}
}
_ = Logger(config)
logger = Logger(config)
assert path.exists("sks_evaluation.log")
logger.close()
remove("sks_evaluation.log")
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment