-
Notifications
You must be signed in to change notification settings - Fork 786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(klog):use klog as global log in some logs #230
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lsjbd
reviewed
Nov 26, 2021
YangruiEmma
previously approved these changes
Nov 29, 2021
lsjbd
previously approved these changes
Nov 29, 2021
@liu-song 代码有冲突,需要解决一下。 |
liu-song
changed the title
feat(klog):add sync.pool to localLogger and modify some usage of log
chore(klog):use klog as global log in some logs
Nov 29, 2021
这个测试函数报错是不是目前internal/stats/tracer.go里面的logger 还不能直接替换掉导致的啊? |
感觉没啥关系,是随机数的小概率问题,重试后就 OK 了。 |
lsjbd
approved these changes
Nov 29, 2021
YangruiEmma
approved these changes
Nov 29, 2021
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
尝试修改了一下,不知道是否合适,几个修改的点:
1.当前版的kitex的日志的输出,都会调用 klog/default.go 里面的logf这个函数,所以简单加了一层sync.pool
2.pkg/remote/trans/nphttp2/grpc/log.go 这个文件目前是对klog 再封装了一下,感觉似乎没有太大必要这样做,改成直接调用klog了
3.internal/stats/tracer.go 这里面的几个函数,目前来看,传递logger ,klog.Formatlogger 都是为了再tryRecover 里面进行一个日志的输出,是否直接调用klog 就可以。; )