Option C Tools
Loading...
Searching...
No Matches
log_writer Namespace Reference

Functions

Path write_command_log (Path project_root, str command, dict data)

Detailed Description

Purpose
-------
Write structured JSON command logs to the project's log directory.

Responsibilities
----------------
- Resolve the log directory via :func:`oct.core.option_c_dir.resolve_logs_dir`.
- Create the directory if it does not exist.
- Write JSON with a deterministic filename convention.

Diagnostics
-----------
Domain: OCT-CORE
Levels:
    L3 — log write events

Contracts
---------
- Always writes JSON (``indent=2``, UTF-8).
- Filename: ``oct-{command}-{YYYYMMDD-HHMMSS}.json``.
- Returns the written :class:`~pathlib.Path`.

Function Documentation

◆ write_command_log()

Path log_writer.write_command_log ( Path project_root,
str command,
dict data )
Write *data* as JSON to the project log directory.

Returns the path of the written file.

Definition at line 38 of file log_writer.py.