• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In
Build has been canceled!

map-services / company-data-api / 26001659459

17 May 2026 08:20PM UTC coverage: 40.099% (+1.2%) from 38.86%
26001659459

push

github

web-flow
fix: convert to JSON structured logging using `log/slog` (#102)

* fix: automated code generation from Gemini for #101

* chore: iterative updates from Gemini based on PR comment

The requested request middleware has been implemented for the Gin router.

### Summary of Changes

1.  **Created **: Added a new Gin middleware called  which logs the status, method, path, query, latency, and client IP of every request.
2.  **Updated **:
    *   Imported .
    *   Registered  in the  chain of the API server.

The code has been verified and compiles correctly.

* chore: iterative updates from Gemini based on PR comment

The `RequestLogger` middleware has been refactored to support variadic exclude paths and now mirrors the implementation pattern from the requested repository. Unit tests have been added to verify that the middleware correctly logs standard requests and skips excluded paths.

### Changes Summary
- **Refactored `internal/middleware/request.go`**: Updated `RequestLogger` to accept a logger and variadic `excludedPaths`. It now correctly filters requests based on the provided paths and uses the `slog` logger with consistent formatting.
- **Updated `cmd/api_server.go`**: Updated the middleware configuration to pass `slog.Default()` and the excluded paths (`/healthz` and `/metrics`) to `RequestLogger`.
- **Added `internal/middleware/request_test.go`**: Created new unit tests to confirm the logging behavior and path exclusion logic, ensuring they function as expected in `gin` environments.

Tests have been verified to pass using `go test`.

* refactor: centralize logger and unify init flow

- Moved `pkg/logger` to `internal/logger.go` to enforce internal usage.
- Standardized application initialization by returning the logger
instance.
- Updated `godx` diagnostics to consume the configured logger.
- Removed redundant Gin logger middleware to streamline output.

```mermaid
graph LR
    subgraph Initialization
    A[Entry Point] --> B[internal.SetupLogg... (continued)

30 of 88 new or added lines in 11 files covered. (34.09%)

5 existing lines in 3 files now uncovered.

324 of 808 relevant lines covered (40.1%)

0.46 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/cmd/code_point.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc