Skip to content

Commit

Permalink
Made group logger creation public (#1171)
Browse files Browse the repository at this point in the history
* made group logger creation public

Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com>

* renamed grouping method

Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com>
  • Loading branch information
Mixaster995 authored Nov 24, 2021
1 parent 518ed72 commit 658a1ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/tools/log/grouplogger.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ type groupLogger struct {
loggers []Logger
}

func newGroup(s ...Logger) Logger {
// Combine creates grouped logger from all provided loggers
func Combine(s ...Logger) Logger {
return &groupLogger{loggers: s}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/tools/log/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func Join(ctx context.Context, log Logger) context.Context {

// WithLog - creates new context with `log` inside
func WithLog(ctx context.Context, log ...Logger) context.Context {
return context.WithValue(ctx, logKey, newGroup(log...))
return context.WithValue(ctx, logKey, Combine(log...))
}

// Fields - returns fields from context
Expand Down

0 comments on commit 658a1ca

Please sign in to comment.