From 1f3dcc82e1f0ec4511d99f0d4e776e9292382b55 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Fri, 3 Jun 2022 17:58:19 +1000 Subject: [PATCH] chore: don't log SQL when DEBUG=true unless PACT_BROKER_SQL_LOG_LEVEL is set and not none --- lib/db.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/db.rb b/lib/db.rb index cf648a488..017f9e741 100644 --- a/lib/db.rb +++ b/lib/db.rb @@ -28,7 +28,7 @@ module DB def self.connect db_credentials # Keep this conifiguration in sync with lib/pact_broker/app.rb#configure_database_connection Sequel.datetime_class = DateTime - if ENV["DEBUG"] == "true" && ENV["PACT_BROKER_SQL_LOG_LEVEL"] != "none" + if ENV["DEBUG"] == "true" && ENV["PACT_BROKER_SQL_LOG_LEVEL"] && ENV["PACT_BROKER_SQL_LOG_LEVEL"] != "none" logger = Logger.new($stdout) end if db_credentials.fetch("adapter") == "sqlite"