diff --git a/example/config.ru b/example/config.ru index 902c71744..ac0c9e29e 100644 --- a/example/config.ru +++ b/example/config.ru @@ -27,7 +27,7 @@ app = PactBroker::App.new do | config | # change these from their default values if desired # config.log_dir = "./log" # config.auto_migrate_db = true - config.database_connection = Sequel.connect(DATABASE_CREDENTIALS.merge(:logger => config.logger)) + config.database_connection = Sequel.connect(DATABASE_CREDENTIALS.merge(:logger => PactBroker::DB::LogQuietener.new(config.logger))) end run app diff --git a/lib/pact_broker/db/log_quietener.rb b/lib/pact_broker/db/log_quietener.rb index 99cf84cad..67cb00b68 100644 --- a/lib/pact_broker/db/log_quietener.rb +++ b/lib/pact_broker/db/log_quietener.rb @@ -1,3 +1,9 @@ +# To reduce the noise of the SQL logs, this class changes INFO +# logs to DEBUG, and changes the ERROR logs that occur when +# Sequel doesn't know if a table/view exists or not to DEBUG, +# so that they don't freak newbies out when they start up the +# broker for the first time. + require 'delegate' module PactBroker