Skip to content

Commit ceb197d

Browse files
cat-log: include version control info (#6924)
* cat-log: include version control info - Allow `--file v` for the `log/version/vcs.json` file - Include `log/version` in list-dir mode * Fix missing newline at end of VCS log files * Changelog
2 parents c3e1d20 + 3b71027 commit ceb197d

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

changes.d/6924.feat.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Include `log/version/` files in `cylc cat-log` and the UI log view.

cylc/flow/install_plugins/log_vc_info.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,8 @@ def write_vc_info(
285285
)
286286
info_file.parent.mkdir(exist_ok=True, parents=True)
287287
with open(info_file, 'w') as f:
288-
f.write(
289-
json.dumps(info, indent=JSON_INDENT)
288+
print(
289+
json.dumps(info, indent=JSON_INDENT), file=f
290290
)
291291

292292

@@ -356,7 +356,7 @@ def write_diff(
356356
try:
357357
_run_cmd(vcs, args, repo_path, stdout=f)
358358
except VCSMissingBaseError as exc:
359-
f.write(f"# No diff - {exc}")
359+
print(f"# No diff - {exc}", file=f)
360360
return diff_file
361361

362362

cylc/flow/scripts/cat_log.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
),
107107
'i': ('install log', r'install/*-*install.log'),
108108
's': ('scheduler log', r'scheduler/*-*start*.log'),
109+
'v': ('version control info (JSON)', r'version/*'),
109110
}
110111

111112

0 commit comments

Comments
 (0)