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
Move debug output to STDERR #1543
Conversation
@@ -12,7 +12,7 @@ module Common | |||
|
|||
def logger | |||
return @logger if @logger | |||
@logger = Logger.new(STDOUT) | |||
@logger = Logger.new(ENV["DEBUG"] ? STDERR : STDOUT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the Logger just always use STDERR
?
Could all of the |
@@ -46,7 +46,7 @@ def initialize(api_url, token = nil, options = {}) | |||
uri = URI.parse(@api_url) | |||
@host = uri.host | |||
|
|||
@logger = Logger.new(STDOUT) | |||
@logger = Logger.new(ENV["DEBUG"] ? STDERR : STDOUT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least here this can just be STDERR
, since there are only logger.debug ...
calls in the class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the logging should be unified anyways at some point.
Just a thought, but couldn't you just provide an option for outputting the configs to a file instead of stdout i.e. something like: |
This will also help with piping to other commands when debug=true. |
True |
Fixes #1542