Skip to content

Commit 2f014f0

Browse files
committed
feat: add LogQuietener to example config.ru
1 parent 34f44bc commit 2f014f0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

example/config.ru

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ app = PactBroker::App.new do | config |
2727
# change these from their default values if desired
2828
# config.log_dir = "./log"
2929
# config.auto_migrate_db = true
30-
config.database_connection = Sequel.connect(DATABASE_CREDENTIALS.merge(:logger => config.logger))
30+
config.database_connection = Sequel.connect(DATABASE_CREDENTIALS.merge(:logger => PactBroker::DB::LogQuietener.new(config.logger)))
3131
end
3232

3333
run app

lib/pact_broker/db/log_quietener.rb

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# To reduce the noise of the SQL logs, this class changes INFO
2+
# logs to DEBUG, and changes the ERROR logs that occur when
3+
# Sequel doesn't know if a table/view exists or not to DEBUG,
4+
# so that they don't freak newbies out when they start up the
5+
# broker for the first time.
6+
17
require 'delegate'
28

39
module PactBroker

0 commit comments

Comments
 (0)