class Magellan::Gcs::Proxy::ProgressNotifierAdapter

Attributes

logger[R]

Public Class Methods

new(logger) click to toggle source
# File lib/magellan/gcs/proxy/progress_notifier_adapter.rb, line 8
def initialize(logger)
  @logger = logger
end

Public Instance Methods

ltsv(hash) click to toggle source
# File lib/magellan/gcs/proxy/progress_notifier_adapter.rb, line 12
def ltsv(hash)
  hash.map { |k, v| "#{k}:#{v}" }.join("\t")
end
notify(severity, job_message, data, attrs) click to toggle source
# File lib/magellan/gcs/proxy/progress_notifier_adapter.rb, line 16
def notify(severity, job_message, data, attrs)
  d = { job_message_id: job_message.message_id }.merge(attrs)
  d[:data] = data # Show data at the end of string
  logger.send(severity, ltsv(d))
end