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

Context.ServerError and NotFound should log from their caller #6550

Merged

Conversation

zeripath
Copy link
Contributor

@zeripath zeripath commented Apr 9, 2019

When Context.ServerError and NotFound log, they can mask the true location of the error by setting their skip too low. This PR makes their log calls appear as if they're coming from their caller. This will seriously help debugging.

@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Apr 9, 2019
@zeripath zeripath added this to the 1.9.0 milestone Apr 9, 2019
@codecov-io
Copy link

codecov-io commented Apr 9, 2019

Codecov Report

Merging #6550 into master will increase coverage by <.01%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6550      +/-   ##
==========================================
+ Coverage   40.35%   40.36%   +<.01%     
==========================================
  Files         405      405              
  Lines       54251    54255       +4     
==========================================
+ Hits        21892    21899       +7     
+ Misses      29343    29340       -3     
  Partials     3016     3016
Impacted Files Coverage Δ
modules/context/context.go 53.68% <50%> (-0.08%) ⬇️
modules/log/event.go 65.98% <0%> (+1.52%) ⬆️
modules/log/log.go 71.42% <0%> (+1.68%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2b9b331...3a84a06. Read the comment docs.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 9, 2019
@lafriks lafriks merged commit 0af0b07 into go-gitea:master Apr 9, 2019
@zeripath zeripath deleted the context-should-log-as-if-from-caller branch April 9, 2019 19:48
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants