Skip to content

Slog logging#14

Merged
MichaelBoegner merged 17 commits intomainfrom
feature/slog
Sep 28, 2025
Merged

Slog logging#14
MichaelBoegner merged 17 commits intomainfrom
feature/slog

Conversation

@MichaelBoegner
Copy link
Owner

@MichaelBoegner MichaelBoegner commented Sep 18, 2025

Summary

This PR replaces Go's standard log package with structured logging using the slog package. The changes add a logger instance to the Handler struct and update all logging statements to use the structured logger instead of the standard library's log.Printf calls.

  • Adds structured logging with slog.Logger throughout the handlers package and corresponding services using structs/methods (will be added to remaining services after they are converted to structs/methods)
  • Updates the Handler struct to include a logger field and modifies the constructor to accept it
  • Replaces all log.Printf calls with h.Logger.Error calls for consistent structured logging

@MichaelBoegner MichaelBoegner self-assigned this Sep 18, 2025
@MichaelBoegner MichaelBoegner added the enhancement New feature or request label Sep 18, 2025
Copy link

Copilot AI left a comment

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 replaces Go's standard log package with structured logging using the slog package. The changes add a logger instance to the Handler struct and update all logging statements to use the structured logger instead of the standard library's log.Printf calls.

  • Adds structured logging with slog.Logger throughout the handlers package
  • Updates the Handler struct to include a logger field and modifies the constructor to accept it
  • Replaces all log.Printf calls with h.Logger.Error calls for consistent structured logging

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
internal/server/server.go Removes test logging and passes logger to handler constructor
handlers/model.go Adds logger field to Handler struct and updates constructor signature
handlers/handlers.go Replaces all log.Printf calls with structured logger error calls

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 8 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@MichaelBoegner MichaelBoegner merged commit 3278dc1 into main Sep 28, 2025
1 check passed
@MichaelBoegner MichaelBoegner deleted the feature/slog branch September 28, 2025 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants