47 """Write *data* as JSON to the project log directory.
49 Returns the path of the written file.
51 func =
"write_command_log"
52 _dbg(
"OCT-CORE", func, f
"writing the {command} log under {project_root}", 3)
53 log_dir = resolve_logs_dir(project_root)
54 log_dir.mkdir(parents=
True, exist_ok=
True)
55 stamp = datetime.now().strftime(
"%Y%m%d-%H%M%S")
56 log_path = log_dir / f
"oct-{command}-{stamp}.json"
57 log_path.write_text(json.dumps(data, indent=2), encoding=
"utf-8")