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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. At least here this can just be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All the logging should be unified anyways at some point. |
||
@logger.level = ENV["DEBUG"].nil? ? Logger::INFO : Logger::DEBUG | ||
@logger.progname = 'CLIENT' | ||
|
||
|
@@ -135,7 +135,7 @@ def authentication_ok?(token_verify_path) | |
request(path: final_path) | ||
true | ||
rescue | ||
ENV["DEBUG"] && puts("Authentication verification exception: #{$!} #{$!.message} #{$!.backtrace}") | ||
logger.debug "Authentication verification exception: #{$!} #{$!.message} #{$!.backtrace}" | ||
false | ||
end | ||
|
||
|
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
?