Skip to content

Commit

Permalink
feat: allow Pactflow messages in logs to be hidden by setting PACT_BR…
Browse files Browse the repository at this point in the history
…OKER_HIDE_PACTFLOW_MESSAGES=true
  • Loading branch information
bethesque committed May 31, 2020
1 parent f7ab8cc commit a755010
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/pact_broker/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ def running_app
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"
if ENV['PACT_BROKER_HIDE_PACTFLOW_MESSAGES'] != 'true'
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
end
4 changes: 3 additions & 1 deletion lib/pact_broker/logging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ 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\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"
if ENV['PACT_BROKER_HIDE_PACTFLOW_MESSAGES'] != 'true'
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"
end
end
end

Expand Down

0 comments on commit a755010

Please sign in to comment.