go-kratos / kratos

Your ultimate Go microservices framework for the cloud-native era.
https://go-kratos.dev
MIT License
23.43k stars 4.01k forks source link

fix(log): GetLogger doesn't returns the same logger that was set before. #3420

Closed kvii closed 4 weeks ago

kvii commented 2 months ago

Description (what this PR does / why we need it):

Let log.GetLogger returns its stored value directly.

Which issue(s) this PR fixes (resolves / be part of):

fixes #3417

Other special notes for the reviewers:

Have breaking changes. GetLogger not always return the same Logger. I know there is a function called Context. But sometimes we need to use log.WithContext to convert a Logger.