Skip to content

Show bcbench-core logs and pass logging inputs explicitly - #918

Draft
Sun Haoran (haoranpb) wants to merge 1 commit into
core/stack-02-pure-utilitiesfrom
core/stack-03-logging
Draft

Sun Haoran (haoranpb) wants to merge 1 commit into
core/stack-02-pure-utilitiesfrom
core/stack-03-logging

Conversation

@haoranpb

@haoranpb Sun Haoran (haoranpb) commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Stack 3 of the bcbench-core extraction, stacked on #917. Prepares logging for code that logs at INFO (git operations) moving into the library.

Problem: setup_logger keeps the root logger at WARNING (to quiet third-party libraries) and raises only the bcbench logger to INFO. Records from bcbench_core.* modules inherit the root level, so their INFO logs would be dropped. Their warnings and errors already reach the root handlers, including GitHub Actions annotations.

Change:

  • setup_logger raises both bcbench and bcbench_core to INFO (DEBUG with --verbose or runner debug). Third-party loggers stay at WARNING.
  • setup_logger(*, debug, github_actions) takes explicit inputs instead of calling get_config(). The CLI callback derives them from --verbose, RUNNER_DEBUG, and GITHUB_ACTIONS, so bcbench.logger no longer imports config.
  • Convention, documented in the core README and Copilot instructions: core modules log through logging.getLogger(__name__) and never add handlers or set levels; only the CLI entry point configures logging.

Handlers, formatting, redaction, annotations, and get_logger are unchanged.

Tests: TestSetupLogger covers core INFO visibility, third-party suppression, debug levels, and a core error producing exactly one GitHub annotation without duplicate console output.

@haoranpb
Sun Haoran (haoranpb) added this pull request to stack #916 October 2, 2026 13:04
The app raised only the `bcbench` logger above the root's WARNING level,
so INFO logs from bcbench_core modules would be dropped once code that
logs at INFO moves into core.

- setup_logger raises both `bcbench` and `bcbench_core` to INFO (DEBUG
  with debug); third-party loggers stay at WARNING
- setup_logger takes debug and github_actions instead of reading config;
  the CLI callback derives them from --verbose and the environment

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3fa47b3c-f5d6-4c36-9be3-c4fdf2bebe47
@haoranpb Sun Haoran (haoranpb) changed the title Configure logging once at the CLI and include bcbench-core loggers Show bcbench-core logs and pass logging inputs explicitly Oct 2, 2026

This branch has not been deployed

No deployments
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