Skip to content

Commit

Permalink
feat: Rename database logger delegate to LogQuietener
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Oct 28, 2018
1 parent 573d204 commit 34f44bc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/pact_broker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
require 'pact_broker/version'
require 'pact_broker/logging'
require 'pact_broker/app'
require 'pact_broker/db/log_quietener'

module PactBroker
Reform::Form.class_eval do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module PactBroker
module DB
class Logger < SimpleDelegator
class LogQuietener < SimpleDelegator
def info *args
__getobj__().debug(*args)
end
Expand All @@ -24,7 +24,7 @@ def error_is_about_table_not_existing?(args)

def reassure_people_that_this_is_expected(args)
message = args.shift
message = message + " Don't panic. This just happens when Sequel doesn't know if a table/view exists or not."
message = message + " Don't panic. This happens when Sequel doesn't know if a table/view exists or not."
[message] + args
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
require 'pact_broker/db/logger'
require 'pact_broker/db/log_quietener'

module PactBroker
module DB
describe Logger do
let(:logs) { StringIO.new }
let(:wrapped_logger) { ::Logger.new(logs) }

subject { Logger.new(wrapped_logger) }
subject { LogQuietener.new(wrapped_logger) }

describe "error" do
context "when the error is for a table or view that does not exist" do
Expand Down

0 comments on commit 34f44bc

Please sign in to comment.