Module: BbDeploy::Logger
- Included in:
- Deployer
- Defined in:
- lib/bb_deploy/logger.rb
Overview
Helper file for Logging/Slack notifications
Defined Under Namespace
Modules: ConsolidatedLogger
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.logger(phase) ⇒ Object
3 4 5 |
# File 'lib/bb_deploy/logger.rb', line 3 def self.logger(phase) @logger ||= ConsolidatedLogger::Logentries.new(phase) # Phase-specific memoization end |
Instance Method Details
#chat_broadcast(msg, phase:, notify_eng_hub: false) ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/bb_deploy/logger.rb', line 44 def chat_broadcast(msg, phase:, notify_eng_hub: false) = [ { fallback: "Deploying to #{phase}", color: "good", fields: [ { title: "Details", # Work the cuteness back in at some point ... value: msg.gsub("(successful)", ":rocket:"), # .gsub("(hisham)", ":hisham:").gsub("(jusx)", ":jusx:") short: false } ] } ] puts "[ *Deploying to #{phase}* ]" # slack.ping("*Deploying to #{phase}*", attachments: attachment, channel: BbDeploy::Config.deployment_channel) # slack.ping("*Deploying to #{phase}*", attachments: attachment, channel: BbDeploy::Config.engineering_channel) if notify_eng_hub # @consolidated_logger ||= ConsolidatedLogger::Logentries.new(phase) # @consolidated_logger.logger.info("DEPLOY--#{msg}") end |
#slack ⇒ Object
67 68 69 |
# File 'lib/bb_deploy/logger.rb', line 67 def slack @slack ||= Slack::Notifier.new(BbDeploy::Config.slack_webhook_key) end |