Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
reidmorrison authored Sep 5, 2024
2 parents 4979271 + f2558aa commit c663bfd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).

## [unreleased]


## [4.16.1]

- Add Honeybadger and Honeybadger Insights to Appenders doc.
- Fix regression in `SemanticLogger::Appenders#close`

## [4.16.0]

Expand Down
2 changes: 1 addition & 1 deletion lib/semantic_logger/appenders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ def close
closed_appenders = []
each do |appender|
logger.trace "Closing appender: #{appender.name}"
appenders << appender
appender.flush
appender.close
closed_appenders << appender
rescue Exception => e
logger.error "Failed to close appender: #{appender.name}", e
end
Expand Down
11 changes: 11 additions & 0 deletions test/appenders_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,16 @@ class AppendersTest < Minitest::Test
# assert_instance_of SemanticLogger::Appender::Async, appender
# end
end

describe "#close" do
it "closes appenders" do
appender = appenders.add(file_name: "test.log")

appenders.close

assert_equal 0, capture_logger.events.count { |it| it.message.match?(/failed/i) }
assert_equal 0, appenders.size
end
end
end
end

0 comments on commit c663bfd

Please sign in to comment.