Skip to main content

cli.logging_to_stderr()

For one CLI run, print the library’s warnings as bare lines on stderr.

Usage

Source

cli.logging_to_stderr()

INFO messages are included under -v. This is what Python’s last-resort handler printed before #49, so a long path is neither wrapped nor coloured. The handler is removed on exit, so an embedding process keeps its own logging.

The library is quiet: its warnings go through the spice_kernel_db logger, and a script sees them only if it configures logging. main() runs inside this context manager, and so does a host CLI that mounts spice_kernel_db.cli.app (planetarypy’s plp). It is part of the host contract with app and exit_code, and changes only with a major version.

Yields

None
A context manager. Run the app inside the with block.

Examples

>>> from spice_kernel_db.cli import logging_to_stderr
>>> with logging_to_stderr():
...     app()  # the host's Typer app