Background
PR #6 (#6) introduced GitHub API mutations, TOML config loading, and network I/O in create_labels/github.py, create_labels/config.py, create_labels/sync.py, and create_labels/cli.py. None of these modules emit log output, making it difficult to diagnose failures in production or CI without attaching a debugger.
Required work
Add a logging call hierarchy across the runtime layer:
create_labels.github: DEBUG log at token/repo resolution; INFO log before and after each GitHub API call; ERROR log (with HTTP status when available) on GitHubError.
create_labels.sync: DEBUG log per label indicating the determined action (created/updated/unchanged); WARNING on unexpected RuntimeError from GitHub.
create_labels.config: DEBUG log when a config file is loaded; ERROR log on ConfigError.
create_labels.cli: configure a root logging.basicConfig at WARNING level by default; expose a --verbose / -v flag that sets the level to DEBUG.
Use logging.getLogger(__name__) in each module. Do not use f-strings inside log calls; use %-style formatting to comply with the project's ruff logging rules (logging-fstring-interpolation is already listed as a linting rule in pyproject.toml).
Acceptance criteria
- Each runtime module uses a module-level
logger = logging.getLogger(__name__).
- Key decision points (token resolution, API calls, label actions) emit
DEBUG or INFO entries.
--verbose flag enables DEBUG output.
make lint and make test pass with logging added.
docs/developers-guide.md is updated to document the logging strategy.
Raised by @leynos following review of PR #6.
Background
PR #6 (#6) introduced GitHub API mutations, TOML config loading, and network I/O in
create_labels/github.py,create_labels/config.py,create_labels/sync.py, andcreate_labels/cli.py. None of these modules emit log output, making it difficult to diagnose failures in production or CI without attaching a debugger.Required work
Add a
loggingcall hierarchy across the runtime layer:create_labels.github:DEBUGlog at token/repo resolution;INFOlog before and after each GitHub API call;ERRORlog (with HTTP status when available) onGitHubError.create_labels.sync:DEBUGlog per label indicating the determined action (created/updated/unchanged);WARNINGon unexpectedRuntimeErrorfrom GitHub.create_labels.config:DEBUGlog when a config file is loaded;ERRORlog onConfigError.create_labels.cli: configure a rootlogging.basicConfigatWARNINGlevel by default; expose a--verbose/-vflag that sets the level toDEBUG.Use
logging.getLogger(__name__)in each module. Do not use f-strings inside log calls; use%-style formatting to comply with the project's ruff logging rules (logging-fstring-interpolationis already listed as a linting rule inpyproject.toml).Acceptance criteria
logger = logging.getLogger(__name__).DEBUGorINFOentries.--verboseflag enablesDEBUGoutput.make lintandmake testpass with logging added.docs/developers-guide.mdis updated to document the logging strategy.Raised by @leynos following review of PR #6.