Skip to content
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 5 commits into from
Nov 29, 2021
Merged

chore(klog):use klog as global log in some logs #230

merged 5 commits into from
Nov 29, 2021

Conversation

liu-song
Copy link
Contributor

尝试修改了一下,不知道是否合适,几个修改的点:

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 就可以。; )

pkg/klog/default.go Outdated Show resolved Hide resolved
YangruiEmma
YangruiEmma previously approved these changes Nov 29, 2021
lsjbd
lsjbd previously approved these changes Nov 29, 2021
@lsjbd
Copy link
Contributor

lsjbd commented Nov 29, 2021

@liu-song 代码有冲突,需要解决一下。

@liu-song liu-song dismissed stale reviews from lsjbd and YangruiEmma via ed21ec7 November 29, 2021 10:57
@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
@liu-song
Copy link
Contributor Author

这个测试函数报错是不是目前internal/stats/tracer.go里面的logger 还不能直接替换掉导致的啊?

@lsjbd
Copy link
Contributor

lsjbd commented Nov 29, 2021

这个测试函数报错是不是目前internal/stats/tracer.go里面的logger 还不能直接替换掉导致的啊?

感觉没啥关系,是随机数的小概率问题,重试后就 OK 了。

@YangruiEmma YangruiEmma merged commit 999ec12 into cloudwego:develop Nov 29, 2021
@liu-song liu-song deleted the klog branch November 30, 2021 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants