Skip to content

Commit

Permalink
[DEV-5758] Log product feature
Browse files Browse the repository at this point in the history
  • Loading branch information
evrenguden authored Jul 4, 2024
1 parent 85ebe36 commit 6af1fd6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions key/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const (
User = "user"
CorrelationID = "correlation_id"
Tool = "tool"
ProductFeature = "product_feature"
)

type ctxKey int
Expand All @@ -25,4 +26,5 @@ const (
CtxCompany
CtxCorrelationID
CtxTool
CtxProductFeature
)
1 change: 1 addition & 0 deletions zap/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func (w *Logger) With(ctx context.Context, keysAndValues ...any) logi.Logger {
addNotEmpty(key.CompanyKey, ctx.Value(key.CtxCompany))
addNotEmpty(key.CorrelationID, ctx.Value(key.CtxCorrelationID))
addNotEmpty(key.Tool, ctx.Value(key.CtxTool))
addNotEmpty(key.ProductFeature, ctx.Value(key.CtxProductFeature))
}

fields = append(fields, keysAndValues...)
Expand Down

0 comments on commit 6af1fd6

Please sign in to comment.