Skip to content

[log] Replace standard log calls with logHealth in health_monitor.go - #4772

Merged
lpcox merged 2 commits into
mainfrom
log/health-monitor-logging-702e6a081853cad3
Apr 29, 2026
Merged

[log] Replace standard log calls with logHealth in health_monitor.go#4772
lpcox merged 2 commits into
mainfrom
log/health-monitor-logging-702e6a081853cad3

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

internal/launcher/health_monitor.go declared logHealth = logger.New("launcher:health") (the project's structured debug logger) but two functions still used the standard library log.Printf instead:

  • Start()log.Printf("[HEALTH] Starting health monitor ...")
  • handleErrorState()log.Printf("[HEALTH] Successfully restarted server %q", serverID)

Changes

  • Replace log.Printf("[HEALTH] Starting...") with logHealth.Printf("Starting health monitor: interval=%v", ...)
  • Replace log.Printf("[HEALTH] Successfully restarted...") with logHealth.Printf("Successfully restarted server: serverID=%s", ...)
  • Remove now-unused "log" standard library import

Why

Per AGENTS.md, all debug output should go through the project's logger (logger.New(...)) rather than the standard library log package. This ensures:

  • Debug output is controlled by DEBUG=launcher:* env var
  • Consistent timestamp diffs and color output in terminals
  • All debug messages are captured to the file logger

Files Modified

  • internal/launcher/health_monitor.go — 1 file, 2 log call replacements, 1 import removed

Validation

  • go build ./...
  • go vet ./...

Generated by Go Logger Enhancement · ● 2.4M ·

The health_monitor.go file declared logHealth = logger.New("launcher:health")
but two functions (Start and handleErrorState) still used the standard
library log.Printf instead of the project's structured logger.

- Replace log.Printf("[HEALTH] Starting...") with logHealth.Printf
- Replace log.Printf("[HEALTH] Successfully restarted...") with logHealth.Printf
- Remove now-unused "log" standard library import

This makes logging consistent with the rest of the file and the project's
debug logging conventions described in AGENTS.md.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added automation enhancement New feature or request labels Apr 29, 2026
@lpcox
lpcox marked this pull request as ready for review April 29, 2026 14:36
Copilot AI review requested due to automatic review settings April 29, 2026 14:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR standardizes health monitor debug logging by replacing remaining log.Printf calls with the project’s structured debug logger (logHealth) and removing the now-unused standard library log import.

Changes:

  • Replace log.Printf usage in Start() with logHealth.Printf(...).
  • Replace log.Printf usage in handleErrorState() with logHealth.Printf(...).
  • Remove unused log import from health_monitor.go.
Show a summary per file
File Description
internal/launcher/health_monitor.go Switches remaining standard-library logging to logHealth and cleans up the import list.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Comment thread internal/launcher/health_monitor.go Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@lpcox
lpcox merged commit 3e98329 into main Apr 29, 2026
6 checks passed
@lpcox
lpcox deleted the log/health-monitor-logging-702e6a081853cad3 branch April 29, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants