oct
Loading...
Searching...
No Matches
diagnostics Namespace Reference

Functions

None _dbg (str domain, str func, str msg, int|str|None level=None, bool override=False, int _depth=1)

Detailed Description

Purpose
-------
OI-525 - single source of truth for the ``_dbg()`` import used across OCT
modules. The ``oc_diagnostics`` package is an optional runtime dependency;
when unavailable (dev-time tooling, partial installs, tests running outside
a full environment) ``_dbg()`` becomes a no-op so callers never crash.

Responsibilities
----------------
- Expose ``_dbg`` re-bound from ``oc_diagnostics`` when importable.
- Fall back to a no-op stub whose signature is EXACTLY ``oc_diagnostics._dbg``'s
  (names, kinds, defaults) - no extra tolerance, so code that only ever ran
  against the stub cannot silently depend on laxness the real callable
  rejects (the plan-213 E0 lesson).
- Never raise on import.

Diagnostics
-----------
Domain: OCT-CORE
Levels:
    L2 - reserved (this module provides the plumbing and emits nothing itself)
    L3 - reserved
    L4 - reserved

Contracts
---------
- Every OCT module that needs ``_dbg`` must import from here rather than
  duplicating the try/except stub.
- Signature must match ``oc_diagnostics._dbg`` so swap is transparent.

Dependencies
------------
- oc_diagnostics (the real _dbg, re-exported when the package is importable)

Function Documentation

◆ _dbg()

None diagnostics._dbg ( str domain,
str func,
str msg,
int | str | None level = None,
bool override = False,
int _depth = 1 )
protected

Definition at line 49 of file diagnostics.py.