enable()
str | Path | None
default:"None"
Where to place (or find) the
.slomo/ data directory. Defaults to auto-detection from the current working directory. The directory containing .slomo/ becomes the project root — the boundary auto-tracing uses to decide what counts as project code.dict[str, str] | None
default:"None"
Arbitrary key-value labels stored in the session’s metadata, e.g.
labels={"service": "checkout", "env": "staging"}. Visible in slomo session show.bool
default:"True"
Install the automatic hooks (auto-trace, exceptions, snapshots, SQL, HTTP, logging). With
hooks=False only explicit @track/snapshot()/event() calls record.disable()
session.finished, flushes, uninstalls hooks). Normally unnecessary — sessions finalize automatically at interpreter exit. Use it when a long-lived process wants to close its recording early.
track
function.enter (args) and function.exit (result, duration_ns), with any escaping exception recorded and re-raised. Works on sync functions, async functions, generators, and async generators; span context propagates across await.
bool
default:"True"
Record positional and keyword arguments on enter.
bool
default:"True"
Record the return value on exit. (Results that are
None are omitted.)str | None
default:"None"
Span label; defaults to the function’s
__qualname__.@track are registered so auto-tracing never records them twice. When the recorder is disabled the wrapper short-circuits to the original function with near-zero overhead. Usage guide: Manual instrumentation.
snapshot()
variable.snapshot event.
str | None
default:"None"
Positional-only label shown in
slomo vars and replay, e.g. "before-retry".Any
Keyword arguments to capture. Values pass through truncation and redaction before being written.
event()
custom event.
str
required
Event name, e.g.
"cache.warmed". Searchable via slomo search.str
default:"info"
One of
debug, info, warning, error, critical. Unknown strings fall back to info. Severity warning+ appears in slomo timeline --errors.Any
Arbitrary keyword payload, truncated and redacted like all captures.
install_hooks()
requests/httpx only if those modules are already imported — if you import one after enable(), call this to attach retroactively:
flush()
os._exit(), exec*) or before reading .slomo/ from the same process.
__version__
Stability
These seven names are the supported surface. Modules underslomo._core and other internals are private and may change without notice.