Skip to content
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

change: change log level of init message to DEBUG #497

Merged
merged 3 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ adheres to [Semantic Versioning](http://semver.org/).

### Changed
- Accept three arguments for the Sidekiq error handler (#495)
- Log level of init message changed to DEBUG (#497)

## [5.2.1] - 2023-03-14
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion lib/honeybadger/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def init!(opts = {}, env = ENV)
init_logging!
init_backend!

logger.info(sprintf('Initializing Honeybadger Error Tracker for Ruby. Ship it! version=%s framework=%s', Honeybadger::VERSION, detected_framework))
logger.debug(sprintf('Initializing Honeybadger Error Tracker for Ruby. Ship it! version=%s framework=%s', Honeybadger::VERSION, detected_framework))
logger.warn('Development mode is enabled. Data will not be reported until you deploy your app.') if warn_development?

self
Expand Down
12 changes: 9 additions & 3 deletions spec/features/test_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@
expect(run_command("honeybadger test")).to be_successfully_executed
expect(all_output).not_to match /Detected Rails/i
expect(all_output).to match /asdf/
expect(all_output).to match /Initializing Honeybadger/
expect(all_output).to match /HoneybadgerTestingException/
# Make sure the worker timeout isn't being exceeded.
expect(all_output).not_to match /kill/
assert_notification('error' => {'class' => 'HoneybadgerTestingException'})
end


it "displays init message when debugging" do
set_environment_variable('HONEYBADGER_API_KEY', 'asdf')
set_environment_variable('HONEYBADGER_DEBUG', '1')
expect(run_command("honeybadger test")).to be_successfully_executed
expect(all_output).to match /Initializing Honeybadger/
end

context "with invalid configuration" do
it "displays expected debug output" do
expect(run_command("honeybadger test --dry-run")).not_to be_successfully_executed
Expand All @@ -32,9 +38,9 @@
api_key: 'asdf'
YML
expect(run_command("honeybadger test")).to be_successfully_executed

expect(all_output).to match /Detected Rails/i
expect(all_output).to match /asdf/
expect(all_output).to match /Initializing Honeybadger/
expect(all_output).to match /HoneybadgerTestingException/
assert_notification('error' => {'class' => 'HoneybadgerTestingException'})
end
Expand Down