Skip to content

Conversation

@smola
Copy link
Contributor

@smola smola commented Jul 14, 2017

  • Remove notifiers: we did use them only for logging, and we did
    not remove logger usage with them anyway.
  • Propagate logger instances (no global logger) and defined context.
    This improves log message by ensuring proper context fields are
    not missing.

@codecov
Copy link

codecov bot commented Jul 14, 2017

Codecov Report

Merging #111 into master will increase coverage by 0.37%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #111      +/-   ##
==========================================
+ Coverage    65.9%   66.27%   +0.37%     
==========================================
  Files          11       11              
  Lines         871      845      -26     
==========================================
- Hits          574      560      -14     
+ Misses        236      221      -15     
- Partials       61       64       +3
Impacted Files Coverage Δ
common.go 57.3% <ø> (ø) ⬆️
worker_pool.go 61.53% <100%> (+0.75%) ⬆️
git.go 73.68% <100%> (ø) ⬆️
archiver.go 60.94% <52.38%> (+2.9%) ⬆️
producer.go 73.21% <71.42%> (-8.76%) ⬇️
worker.go 54.28% <75%> (ø) ⬆️

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 9a5fa22...23f8b83. Read the comment docs.

@smola smola requested a review from ajnavarro July 14, 2017 15:28
@smola smola added the enhancement New feature or request label Jul 14, 2017
archiver.go Outdated

gr, err := a.TemporaryCloner.Clone(j.RepositoryID.String(), endpoint)
if err != nil {
if err == transport.ErrRepositoryNotFound {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this is necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not.

return ResolveCommit(r, o.Target)
default:
log.Warn("referenced object not supported", "type", o.Type())
log15.Warn("referenced object not supported", "hash", h.String(), "type", o.Type())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this log is missing the context too, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, the way it is structured right now, this function doesn't get context. We might want to fix in a future PR?

@ajnavarro
Copy link
Contributor

@smola did you have a chance to have a look to this PR?

@ajnavarro
Copy link
Contributor

@smola ping

@smola smola force-pushed the context-logging branch from b24fac2 to 3b1262b Compare August 1, 2017 16:13
@smola
Copy link
Contributor Author

smola commented Aug 1, 2017

@ajnavarro pong ;)

* Remove notifiers: we used them only for logging, and we did
  not remove logger usage with them anyway.
* Propagate logger instances (no global logger) and defined context.
  Since we never define a global logger, and only the main entry point
  instantiates a logger from scratch, it's harder to miss propagating
  the right context in the logger.
@smola smola force-pushed the context-logging branch from 3b1262b to 23f8b83 Compare August 2, 2017 08:58
@ajnavarro ajnavarro merged commit 872091a into src-d:master Aug 2, 2017
@smola smola deleted the context-logging branch August 2, 2017 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants