Skip to content

[Ported] feat(sensor): add --log-level/--quiet and log observer and CLI output - #142

Merged
barisozbas merged 5 commits into
mainfrom
port/logger-observer-cli
Sep 29, 2026
Merged

barisozbas merged 5 commits into
mainfrom
port/logger-observer-cli

Conversation

@v314b0i

@v314b0i v314b0i commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Related issue: N/A

What changed? (consolidates the remaining logging stack from #142, #143, and #144; targets main)

  1. feat: --log-level {debug,info,warning,error} (default info) and -q/--quiet (same as warning). The two are mutually exclusive.
  2. refactor: observer progress is INFO. A failed source or session save is ERROR, and recoverable cleanup and comparison problems are WARNING, tagged with phase (parse/save).
  3. refactor: CLI progress is INFO. OTLP export and checkpoint failures are ERROR, and the checkpoint-retry notice and "completed with errors" are WARNING.
  4. refactor: the diagnostics write-failure notice is a WARNING. It is still shown once and still carries no exception text.
  5. docs: the README CLI usage section.
  6. refactor: includes [Ported] refactor(sensor): route parser output through the sensor logger #143's parser logging across all ten capture sources and the updated CONTRIBUTING parser template.
  7. feat: includes [Ported] feat(sensor): add an opt-in persistent runtime log #144's opt-in rotating runtime JSONL logs via --log-file, with --log-file-content-free and --log-identity options, tests, and documentation.

#139 and #140 are already merged into main. The consolidation preserves all commits from #142, #143, and #144 and reconciles the squash-merge ancestry of #140. The resolved source tree is identical to #144's complete stack at f8d95745b76b399cb15d848bc41bc143a10523c0.

display_summary() is report output and still uses print(), so the summary table always shows.

Why?
Scheduled runs want quiet output but still want to see problems. Errors printed to stdout were easy to miss or lose in redirected logs.

How did you test it?

Potential risks
Some messages move from stdout to stderr:

  • Error ingesting ...
  • Error saving session ...
  • the observer's cleanup and compare errors
  • completed with errors

Scripts that grep stdout for them need 2>&1. At the default level the text is unchanged.

With --log-file, persisted messages and tracebacks can contain local paths and error text; --log-file-content-free omits them. Runtime files and identity recording remain opt-in.

@v314b0i
v314b0i added this pull request to stack #141 September 27, 2026 22:18
@barisozbas
barisozbas force-pushed the port/logger-observer-cli branch from 57e1706 to ebcedd6 Compare September 28, 2026 07:47
barisozbas
barisozbas previously approved these changes Sep 28, 2026
barisozbas added a commit that referenced this pull request Sep 29, 2026
Combine the remaining logging stack from PRs #142, #143, and #144. Reconcile main's squashed resource-log rotation ancestry while preserving the complete runtime-log branch tree.
@barisozbas
barisozbas removed this pull request from stack #141 September 29, 2026 11:13
@barisozbas
barisozbas changed the base branch from port/resource-log-rotation to main September 29, 2026 11:14
@barisozbas
barisozbas dismissed their stale review September 29, 2026 11:14

The base branch was changed.

Expose the sensor logger's console threshold on the CLI:
--log-level {debug,info,warning,error} (default info) and -q/--quiet,
which is shorthand for --log-level warning. The two are mutually
exclusive. Nothing logs through the sensor logger yet, so output is
unchanged until call sites move over.
… the sensor logger

Replace the observer's progress and error print() calls with leveled
records on the adr_sensor.observer logger, tagged with a parse or save
phase. At the default level the text on the console is unchanged.

- progress ("Ingesting ...", "Saved session ...") is INFO on stdout
- a failed source or failed session save is ERROR and now goes to stderr
- recoverable cleanup and comparison problems are WARNING on stderr

display_summary() is report output rather than logging and keeps print().
…sensor logger

Replace the CLI's print() calls with records on the adr_sensor.cli logger.
Progress and the completion line are INFO on stdout; export and checkpoint
failures stay on stderr as ERROR, and the checkpoint-retry notice as
WARNING. "Completed with errors" is now a WARNING, so it goes to stderr
and still shows with --quiet.
Emit the "Unable to write sensor diagnostics" notice as a WARNING on the
adr_sensor.diagnostics logger instead of printing to stderr. It still
reaches stderr once per run and still carries no exception text.
Describe --log-level and -q/--quiet in the README CLI usage section,
including where progress and errors are printed and that the ingestion
summary is always shown.
@v314b0i
v314b0i force-pushed the port/logger-observer-cli branch from 3950b56 to beb9f3d Compare September 29, 2026 12:20
@v314b0i
v314b0i added this pull request to stack #148 September 29, 2026 12:25
@barisozbas
barisozbas merged commit 985fb70 into main Sep 29, 2026
14 checks passed
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.

3 participants