Skip to content

Commit 16f478e

Browse files
authored
Merge pull request #3215 from vkarak/bugfix/file-handler-timestamp-boolean
[bugfix] Fix logging crash when `timestamp=True` for the `file` log handler
2 parents 5fa59e1 + 79b894d commit 16f478e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

reframe/core/logging.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,10 @@ def _create_file_handler(site_config, config_prefix):
428428
timestamp = site_config.get(f'{config_prefix}/timestamp')
429429
if timestamp:
430430
basename, ext = os.path.splitext(filename)
431+
if not isinstance(timestamp, str):
432+
# Use the default value from `datefmt`
433+
timestamp = site_config.get(f'{config_prefix}/datefmt')
434+
431435
filename = f'{basename}_{time.strftime(timestamp)}{ext}'
432436

433437
append = site_config.get(f'{config_prefix}/append')

0 commit comments

Comments
 (0)