MCPcopy Create free account
hub / github.com/T0UGH/codex-self-evolution-plugin / _log_command

Function _log_command

src/codex_self_evolution/cli.py:1007–1026  ·  view source on GitHub ↗

Emit one structured summary line per CLI invocation. Called at the boundary of ``main()`` so each hook / scheduler / manual CLI call leaves exactly one record behind. Per-step logs inside compile / reviewer / scan are intentionally NOT added here — start with the boundary and push i

(
    logger, command: str, started: float, *, exit_code: int, **extras,
)

Source from the content-addressed store, hash-verified

1005
1006
1007def _log_command(
1008 logger, command: str, started: float, *, exit_code: int, **extras,
1009) -> None:
1010 """Emit one structured summary line per CLI invocation.
1011
1012 Called at the boundary of ``main()`` so each hook / scheduler / manual
1013 CLI call leaves exactly one record behind. Per-step logs inside compile /
1014 reviewer / scan are intentionally NOT added here — start with the
1015 boundary and push inward only if an investigation actually needs it.
1016 """
1017 duration_ms = int((time.monotonic() - started) * 1000)
1018 logger.info(
1019 "cli command completed",
1020 extra={
1021 "kind": command or "unknown",
1022 "exit_code": exit_code,
1023 "duration_ms": duration_ms,
1024 **extras,
1025 },
1026 )
1027
1028
1029if __name__ == "__main__":

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected