kratos icon indicating copy to clipboard operation
kratos copied to clipboard

feat: slog

Open songzhibin97 opened this issue 1 year ago • 6 comments

adaptation of slog

songzhibin97 avatar Oct 07 '23 01:10 songzhibin97

Shall we using slog.Handler internally instead of slog.Logger? I mean, it will cause caller path issue. 感觉用 slog.Handler 更合适一点。要不然会出 call path 问题。

Code reference:

https://github.com/golang/go/blob/46ea4ab5cb87e9e5d443029f5f1a4bba012804d3/src/log/slog/logger.go#L241-L253

kvii avatar Dec 11 '23 03:12 kvii

Shall we using slog.Handler internally instead of slog.Logger? I mean, it will cause caller path issue. 感觉用 slog.Handler 更合适一点。要不然会出 call path 问题。

Code reference:

https://github.com/golang/go/blob/46ea4ab5cb87e9e5d443029f5f1a4bba012804d3/src/log/slog/logger.go#L241-L253

You're right. It's more like logger in kratos. It adds call stack.

songzhibin97 avatar Dec 11 '23 07:12 songzhibin97

可能得等到 kratos 版本升到 1.21 之后,这个 PR 才有可能被合并吧……

kvii avatar Dec 27 '23 03:12 kvii

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


You may have to wait until the kratos version is upgraded to 1.21 before this PR can be merged...

kratos-ci-bot avatar Dec 27 '23 03:12 kratos-ci-bot

可能得等到 kratos 版本升到 1.21 之后,这个 PR 才有可能被合并吧……

是的,也有可能不会合,内部讨论可能直接将kratos/l og 平替过来

songzhibin97 avatar Dec 27 '23 03:12 songzhibin97

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


You may have to wait until the kratos version is upgraded to 1.21 before this PR can be merged...

Yes, it is possible that it will not work. Internal discussions may directly refer to kratos/l og replaces it

kratos-ci-bot avatar Dec 27 '23 03:12 kratos-ci-bot