Skip to content

Commit a755010

Browse files
committed
feat: allow Pactflow messages in logs to be hidden by setting PACT_BROKER_HIDE_PACTFLOW_MESSAGES=true
1 parent f7ab8cc commit a755010

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/pact_broker/app.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,9 @@ def running_app
232232
end
233233

234234
def print_startup_message
235-
logger.info "\n\n#{'*' * 80}\n\nWant someone to manage your Pact Broker for you? Check out https://pactflow.io/oss for a hardened, fully supported SaaS version of the Pact Broker with an improved UI + more.\n\n#{'*' * 80}\n"
235+
if ENV['PACT_BROKER_HIDE_PACTFLOW_MESSAGES'] != 'true'
236+
logger.info "\n\n#{'*' * 80}\n\nWant someone to manage your Pact Broker for you? Check out https://pactflow.io/oss for a hardened, fully supported SaaS version of the Pact Broker with an improved UI + more.\n\n#{'*' * 80}\n"
237+
end
236238
end
237239
end
238240
end

lib/pact_broker/logging.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ def log_error e, description = nil
3434
message = "#{e.class} #{e.message}\n#{e.backtrace.join("\n")}"
3535
message = "#{description} - #{message}" if description
3636
logger.error message
37-
logger.info "\n\n#{'*' * 80}\n\nPrefer it was someone else's job to deal with this error? Check out https://pactflow.io/oss for a hardened, fully supported SaaS version of the Pact Broker with an improved UI + more.\n\n#{'*' * 80}\n"
37+
if ENV['PACT_BROKER_HIDE_PACTFLOW_MESSAGES'] != 'true'
38+
logger.info "\n\n#{'*' * 80}\n\nPrefer it was someone else's job to deal with this error? Check out https://pactflow.io/oss for a hardened, fully supported SaaS version of the Pact Broker with an improved UI + more.\n\n#{'*' * 80}\n"
39+
end
3840
end
3941
end
4042

0 commit comments

Comments
 (0)