From 530dbfe939c6d81b252625e0da02f41614d63da0 Mon Sep 17 00:00:00 2001 From: Beth Skurrie Date: Fri, 20 Sep 2019 15:44:17 +1000 Subject: [PATCH] feat: add pactflow message to start up and error logs --- lib/pact_broker/app.rb | 5 +++++ lib/pact_broker/logging.rb | 1 + 2 files changed, 6 insertions(+) diff --git a/lib/pact_broker/app.rb b/lib/pact_broker/app.rb index 87fa2221d..7dcf58645 100644 --- a/lib/pact_broker/app.rb +++ b/lib/pact_broker/app.rb @@ -36,6 +36,7 @@ def initialize &block prepare_database load_configuration_from_database seed_example_data + print_startup_message end # Allows middleware to be inserted at the bottom of the shared middlware stack @@ -223,5 +224,9 @@ def running_app @app_builder end end + + def print_startup_message + 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" + end end end diff --git a/lib/pact_broker/logging.rb b/lib/pact_broker/logging.rb index 80f5e500c..44d90cf42 100644 --- a/lib/pact_broker/logging.rb +++ b/lib/pact_broker/logging.rb @@ -35,6 +35,7 @@ def log_error e, description = nil message = "#{e.class} #{e.message}\n#{e.backtrace.join("\n")}" message = "#{description} - #{message}" if description logger.error message + logger.info "\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.\n\n#{'*' * 80}\n" end end