Skip to content

feat: add warn logger#77

Merged
yeabow merged 2 commits into
mainfrom
feat/add-warn-logger
May 20, 2026
Merged

feat: add warn logger#77
yeabow merged 2 commits into
mainfrom
feat/add-warn-logger

Conversation

@yeabow

@yeabow yeabow commented May 20, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

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 adds a Warn logging helper to the utils/logger package to mirror the existing Info/Error wrappers and include caller metadata in warn-level logs.

Changes:

  • Introduce logger.Warn(message, fields...) wrapper.
  • Attach caller metadata fields to warn logs (consistent with Info/Error).

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

Comment thread utils/logger/log.go
Comment on lines +74 to +77
func Warn(message string, fields ...zap.Field) {
callerFields := getCallerInfoForLog()
fields = append(fields, callerFields...)
loggers.Warn(message, fields...)
Comment thread utils/logger/log.go
Comment on lines +74 to +78
func Warn(message string, fields ...zap.Field) {
callerFields := getCallerInfoForLog()
fields = append(fields, callerFields...)
loggers.Warn(message, fields...)
}
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

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 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread utils/logger/log.go
Comment on lines +74 to +77
func Warn(message string, fields ...zap.Field) {
callerFields := getCallerInfoForLog()
fields = append(fields, callerFields...)
loggers.Warn(message, fields...)
Comment thread utils/logger/log_test.go
Comment on lines +35 to +41
msg := "warn test"

logger.Warn(msg)

output := string(w.Output)
assert.Contains(t, output, "warn")
assert.Contains(t, output, msg)
@yeabow yeabow merged commit b04d640 into main May 20, 2026
3 of 4 checks passed
@yeabow yeabow deleted the feat/add-warn-logger branch May 20, 2026 11:24
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