diff --git a/lib/pact_broker.rb b/lib/pact_broker.rb index de3a2c38f..8ebe32eb6 100644 --- a/lib/pact_broker.rb +++ b/lib/pact_broker.rb @@ -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 diff --git a/lib/pact_broker/db/logger.rb b/lib/pact_broker/db/log_quietener.rb similarity index 82% rename from lib/pact_broker/db/logger.rb rename to lib/pact_broker/db/log_quietener.rb index 93979eccd..99cf84cad 100644 --- a/lib/pact_broker/db/logger.rb +++ b/lib/pact_broker/db/log_quietener.rb @@ -2,7 +2,7 @@ module PactBroker module DB - class Logger < SimpleDelegator + class LogQuietener < SimpleDelegator def info *args __getobj__().debug(*args) end @@ -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 diff --git a/spec/lib/pact_broker/db/logger_spec.rb b/spec/lib/pact_broker/db/log_quietener_spec.rb similarity index 92% rename from spec/lib/pact_broker/db/logger_spec.rb rename to spec/lib/pact_broker/db/log_quietener_spec.rb index 350cdbe1e..6b6ddbd87 100644 --- a/spec/lib/pact_broker/db/logger_spec.rb +++ b/spec/lib/pact_broker/db/log_quietener_spec.rb @@ -1,4 +1,4 @@ -require 'pact_broker/db/logger' +require 'pact_broker/db/log_quietener' module PactBroker module DB @@ -6,7 +6,7 @@ module DB 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