setup(name, *, level, file, json, max_bytes, backup_count, fmt, redact)— one-call logger configuration withRotatingFileHandlerand a TTY-aware console handler (usescodechu-term.is_ttyif installed, elsesys.stderr.isatty).Context(**fields)— context manager backed bycontextvars. Nested scopes merge, child wins on key conflict, propagation survivesawaitandasyncio.Taskboundaries.bind(logger, **fields)andstructured(logger)— return aStructuredLoggerthat lifts call-site kwargs into the structured payload of every record.- JSON formatter emitting one object per line:
ts(ISO-8601 UTC),level,logger,msg,fields,exc_info,pid,thread. - Redaction via
setup(..., redact=[...])— replaces listed keys with<redacted>in both text and JSON output.