Skip to main content

Yukilog

Yukilog is the logging boundary shared by Liteyuki applications. It keeps application code independent from Loguru's sink configuration API while retaining a deliberately isolated compatibility escape hatch for legacy integrations.

Yukilog requires Python 3.14 or newer. Loguru is its only runtime dependency.

Usage

Importing Yukilog does not add, remove, or reconfigure any sink. The application entry point owns configuration:

from yukilog import FileSink, LoggingConfig, configure, get_logger, shutdown

configure(
    LoggingConfig(
        files=(FileSink("logs/app.log", rotation="10 MB", retention="7 days"),),
    )
)

log = get_logger(component="api", runtime="main")
log.info("Listening on {address}", address="127.0.0.1:8000")

with log.contextualize(event_id="evt-42"):
    log.debug("Dispatching event")

shutdown()

configure() with no arguments installs one colored, human-readable stderr sink. Repeated calls with an equal configuration are no-ops. A different configuration replaces sinks previously installed by Yukilog. By default the first call also removes existing Loguru sinks because configuration is an application-level operation; set remove_existing=False when embedding Yukilog in another host.

Every facade logger carries the stable context fields component, plugin, runtime, event_id, and bot_id. Values not known at bind time are null in structured output. Arbitrary additional fields are retained under extra.

Structured output

Use a JSON Lines sink for machine consumers:

from yukilog import JsonSink, LoggingConfig, configure

configure(LoggingConfig(console=None, json=JsonSink()))

Supervised child runtimes use the dedicated marker and stdout-only configuration:

from yukilog import configure_child_runtime

configure_child_runtime(level="DEBUG")

Each emitted line contains "_yukilog":"yukilog.child.v1". The schema marker is part of Yukilog's public protocol; Loguru's private serialized record shape is not.

Standard library logging

intercept_stdlib_logging() replaces handlers on the root standard-library logger and routes propagating records through Yukilog. It is idempotent. shutdown() (or restore_stdlib_logging()) restores the root handlers and level captured at the first interception. Named loggers with propagate=False remain application-owned.

Legacy Loguru compatibility

New code should use yukilog.Logger. Code that genuinely requires Loguru-only methods such as opt() must import the escape hatch explicitly:

from yukilog.compat import get_loguru_logger

legacy_logger = get_loguru_logger(plugin="legacy.example")
legacy_logger.opt(colors=True).info("<green>Loaded</green>")

The returned object is Loguru-compatible and therefore is not covered by the stable facade contract. Sink ownership remains with the application entry point.

Development

uv sync
uv run ruff check .
uv run mypy
uv run pytest
uv build

Metadata

Release files for yukilog 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yukilog 1.0.0
File Size Uploaded Provenance Actions
yukilog-1.0.0.tar.gz 7.6 kB Without provenance Details for yukilog-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for yukilog 1.0.0
File Interpreter ABI Platform Actions
yukilog-1.0.0-py3-none-any.whl Python 3 none any Details for yukilog-1.0.0-py3-none-any.whl

Total release size: 18.5 kB

Release files / yukilog-1.0.0.tar.gz

Download URL yukilog-1.0.0.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2462b7074c03a08660e6b82ae10fc60122df4f12883f7fe125ecefac9eb6f8b1
BLAKE2b-256 checksum
How to use checksums
9d409bef35f0d167e38bc89467bd0caa40439e4643613a7c868e90f4d19b8770
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / yukilog-1.0.0-py3-none-any.whl

Download URL yukilog-1.0.0-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8e5fac4f6b57078b6f357fe2f0116b8d11a13caf2867708d80a7e1a0bd93bc5b
BLAKE2b-256 checksum
How to use checksums
e8979a5e0bf3215778c0767922aeebe1736bd8f81c2d82e75309d8c686f92f23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for yukilog 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page