Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

fix: avoid logging http errors when its logger is not on #1977

Merged
merged 1 commit into from
Apr 4, 2019
Merged

Conversation

jacobheun
Copy link
Contributor

If any logger is turned on via DEBUG, such as DEBUG=libp2p:switch the api errors get logged to console, which makes viewing the actual logs I want rather annoying.

Rather than checking the DEBUG value for http logging, this change has it check the status of the debug logger itself. Rather than defaulting to error level, it now defaults to fatal.

If you use DEBUG=ipfs:http-api or DEBUG=ipfs:http-api:error, you will still get the appropriate log level.

@ghost ghost assigned jacobheun Apr 3, 2019
@ghost ghost added the status/in-progress In progress label Apr 3, 2019
Copy link
Contributor

@dirkmc dirkmc left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@alanshaw
Copy link
Member

alanshaw commented Apr 4, 2019

@jacobheun I've rebased for green CI

@alanshaw alanshaw merged commit 20beea2 into master Apr 4, 2019
@alanshaw alanshaw deleted the fix/logs branch April 4, 2019 13:16
@ghost ghost removed the status/in-progress In progress label Apr 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants