1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-11-23 21:44:41 +02:00

feat(logger): add logger option to all micro components (override DefaultLogger) closes #2556 (#2559)

* feat(logger): add logger option to all components

* fix: refactor api/rpc.go

* fix: refactor api/stream.go

* fix: api/options.go comment

* fix(logger): do not use logger.Helper internally

* fix(logger): fix comments

* fix(logger): use level.Enabled method

* fix: rename mlogger to log

* fix: run go fmt

* fix: log level

* fix: factories

Co-authored-by: Mohamed MHAMDI <mmhamdi@hubside.com>
Co-authored-by: Davincible <david.brouwer.99@gmail.com>
This commit is contained in:
Mohamed MHAMDI
2022-09-29 16:44:53 +02:00
committed by GitHub
parent 57a0ef5a0f
commit 1db36357d5
63 changed files with 818 additions and 673 deletions

View File

@@ -129,3 +129,10 @@ func (h *Helper) WithError(err error) *Helper {
func (h *Helper) WithFields(fields map[string]interface{}) *Helper {
return &Helper{logger: h.logger.Fields(fields)}
}
func HelperOrDefault(h *Helper) *Helper {
if h == nil {
return DefaultHelper
}
return h
}