mirror of
https://github.com/lightbroker/llmsecops-research.git
synced 2026-05-13 12:54:47 +02:00
os.makedirs()
This commit is contained in:
@@ -24,8 +24,13 @@ class TestRunLoggingService(AbstractTestRunLoggingService):
|
||||
timestamp = calendar.timegm(time.gmtime())
|
||||
base_path = os.environ.get('TEST_RUNS', '.')
|
||||
self.log_file_path = os.path.join(base_path, str(f"test_{test_id}/{str(model_id.value).replace("/", "_")}/{start}_{end}/test_{str(test_id).lower()}_logs_{timestamp}.json").lower())
|
||||
|
||||
# Ensure directory structure exists
|
||||
os.makedirs(os.path.dirname(self.log_file_path), exist_ok=True)
|
||||
|
||||
self._ensure_log_file_exists()
|
||||
|
||||
|
||||
def _ensure_log_file_exists(self):
|
||||
if not os.path.exists(self.log_file_path):
|
||||
with open(self.log_file_path, 'w') as f:
|
||||
|
||||
Reference in New Issue
Block a user