Skip to content

fix: set up scalo's logger in every culvert entry point - #60

Merged
catinspace-au merged 1 commit into
mainfrom
fix/scripts-init-logger
Oct 1, 2026
Merged

catinspace-au merged 1 commit into
mainfrom
fix/scripts-init-logger

Conversation

@catinspace-au

Copy link
Copy Markdown
Contributor

Sixteen culvert files log through scalo's logger and no process ever called its setup. So the entrypoint and every operator script ran on loguru's bare default handler: no scalo format, no secret scrubbing, no keyword fields.

  • entrypoint.py, generate-client, revoke-client and update-crl each call scalo.logger.setup() once at the start of main()
  • Level and format come from LOG_LEVEL, LOG_FORMAT and the CULVERT_ cascade, as scalo resolves them
  • otel_tracing=False everywhere, since culvert emits no spans
  • The entrypoint's healthcheck skips setup: it logs nothing and runs every few seconds
  • The unit tier swaps setup for a no-op, or a real sink bound to one test's captured stderr outlives it

Before, update-crl with no PKI:

2026-10-01 20:51:43.063 | ERROR    | __main__:main:87 - PKI directory not found. Initialize PKI first.

After:

2026-10-01T21:00:17.907+1000 | ERROR    | __main__:main:92 - PKI directory not found. Initialize PKI first.

tests/unit/test_logger_setup.py patches setup with a recorder and asserts each entry point calls it once, before its config load. Done when CI is green.

Sixteen files log through scalo's logger and no process ever called its setup. The container entrypoint and the generate-client, revoke-client and update-crl scripts all ran on loguru's bare default handler: no scalo format, no secret scrubbing, and none of the keyword fields the code logs.

Each now calls scalo.logger.setup() once at the start of main(), so LOG_LEVEL, LOG_FORMAT and the CULVERT_ cascade pick the level and format. Span export stays off because culvert emits no spans. The entrypoint's healthcheck skips it, since that probe logs nothing and runs every few seconds.

The unit tier swaps setup for a no-op. A real sink bound to one test's captured stderr outlived it, and loguru reported a handler error when a later test logged.
@catinspace-au
catinspace-au requested a review from a team as a code owner October 1, 2026 11:00
@catinspace-au
catinspace-au merged commit 5709ca0 into main Oct 1, 2026
13 checks passed
@catinspace-au
catinspace-au deleted the fix/scripts-init-logger branch October 1, 2026 11:05
catinspace-au added a commit that referenced this pull request Oct 1, 2026
…#61)

The published image's /etc/vpn/VERSION read "dev" because nothing passed
the release version into the Dockerfile's ARG VERSION build arg. hyperi-ci
now renders it from release.container.build_args.

CULVERT_CRL_DAYS reached Easy-RSA unvalidated, so a zero, negative, or
non-numeric value could break CRL regeneration silently. validate() now
rejects both cases with a clear error; unset still defaults to 180.

Also documents scalo.logger.setup and its four call sites in
docs/scalo-reference.md, closing the Quality "no doc did" warning from #60.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant