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

fix(log): DefaultCaller doesn't returns "pkg/file:line", it returns "… #2274

Merged
merged 1 commit into from
Aug 13, 2022

Conversation

SeniorPlayer
Copy link
Contributor

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

DefaultCaller doesn't returns "pkg/file:line", it returns "file:line" now. For example, both biz/user.go and data/user.go are printed as "user.go" in logger. It's not clear.
With this PR, the log changed from

"caller":"user.go:277"

to

"caller":"biz/user.go:277"

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

None

Other special notes for the reviewers:

…file:line" now. For example, both biz/user.go and data/user.go are printed as user.go in logger. It's not clear.
@codecov-commenter
Copy link

codecov-commenter commented Aug 13, 2022

Codecov Report

Merging #2274 (d0654a9) into main (f0c2a6e) will decrease coverage by 0.09%.
The diff coverage is 33.33%.

@@            Coverage Diff             @@
##             main    #2274      +/-   ##
==========================================
- Coverage   85.57%   85.48%   -0.10%     
==========================================
  Files          87       87              
  Lines        3793     3796       +3     
==========================================
- Hits         3246     3245       -1     
- Misses        380      383       +3     
- Partials      167      168       +1     
Impacted Files Coverage Δ
log/value.go 91.66% <33.33%> (-8.34%) ⬇️
internal/context/context.go 97.01% <0.00%> (-2.99%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@tonybase tonybase merged commit b9b7888 into go-kratos:main Aug 13, 2022
xiongpan828 pushed a commit to xiongpan828/kratos that referenced this pull request Jan 5, 2023
…file:line" now. For example, both biz/user.go and data/user.go are printed as user.go in logger. It's not clear. (go-kratos#2274)

Co-authored-by: SeniorPlayer <SeniorPlayer@gg.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants