Skip to content

Allow overriding the Logger used by Proxy#174

Merged
willnorris merged 4 commits intowillnorris:masterfrom
mattermost:hh-intercept-log
Apr 22, 2019
Merged

Allow overriding the Logger used by Proxy#174
willnorris merged 4 commits intowillnorris:masterfrom
mattermost:hh-intercept-log

Conversation

@hmhealey
Copy link
Copy Markdown
Contributor

Related to #162, I'd like a bit more control over the image proxy's log output so that we can route it through the same logging interface that's used by the rest of our server. That's not currently possible because the Proxy uses the global log.Logger instance, but it's easy enough to get this functionality by giving the Proxy it's own log.Logger instance. By default, it creates its own instance that matches the one in the log package. I'm hoping that this could be useful to others.

There's a few places where the global logger is still used, but that's inside functions that aren't part of the Proxy and in the httpservice.Cache implementations, so changing those would be more intrusive.

@googlebot
Copy link
Copy Markdown
Collaborator

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@hmhealey
Copy link
Copy Markdown
Contributor Author

I signed it!

@googlebot
Copy link
Copy Markdown
Collaborator

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Apr 17, 2019

Codecov Report

Merging #174 into master will increase coverage by 0.31%.
The diff coverage is 87.5%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #174      +/-   ##
=========================================
+ Coverage   84.48%   84.8%   +0.31%     
=========================================
  Files           5       5              
  Lines         490     500      +10     
=========================================
+ Hits          414     424      +10     
  Misses         56      56              
  Partials       20      20
Impacted Files Coverage Δ
imageproxy.go 88.42% <87.5%> (+0.64%) ⬆️

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 e1558d5...e2abb29. Read the comment docs.

@willnorris
Copy link
Copy Markdown
Owner

Looks great! Thanks @hmhealey

@willnorris willnorris merged commit d4246a0 into willnorris:master Apr 22, 2019
@hmhealey hmhealey deleted the hh-intercept-log branch April 23, 2019 16:23
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.

4 participants