module Fluent::NotifyUtil

Public Instance Methods

make_option(record) click to toggle source
# File lib/fluent/plugin/notify_util.rb, line 11
def make_option(record)
  title = record["title"] || @title
  sub_title = record["sub_title"] || @sub_title
  options = {title: title, subtitle: sub_title}
  unless @activate.empty?
    options.merge!(activate: @activate)
  end
  options
end
notify(time, record) click to toggle source
# File lib/fluent/plugin/notify_util.rb, line 5
def notify(time, record)
  message = record["message"] || "#{record.to_json} at #{Time.at(time).localtime}"
  options = make_option(record)
  TerminalNotifier.notify(message, options)
end