Skip to content

Comments

Add Custom Message Ability#77

Merged
samber merged 2 commits intosamber:mainfrom
LRFalk01:main
Feb 13, 2026
Merged

Add Custom Message Ability#77
samber merged 2 commits intosamber:mainfrom
LRFalk01:main

Conversation

@LRFalk01
Copy link
Contributor

Thanks for this module!

I'm curious what the interest level is for the ability to customize the log message itself.

Adding a config such as the following would convert the default log message of Incoming request to something more like this: [200] GET /request/path

WithCustomMessage: func(c *gin.Context) string {
	return fmt.Sprintf(
		"[%d] %s %s",
		c.Writer.Status(),
		c.Request.Method,
		c.Request.URL.Path,
	)
},

@samber samber merged commit b7dbf82 into samber:main Feb 13, 2026
12 checks passed
@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

❌ Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (2e0bde9) to head (49f7a5d).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
middleware.go 0.00% 13 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main     #77   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files          4       4           
  Lines        372     377    +5     
=====================================
- Misses       372     377    +5     
Flag Coverage Δ
unittests 0.00% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants