class ManageIQ::Loggers::Base::Formatter

Constants

FORMAT

Public Instance Methods

call(severity, time, progname, msg) click to toggle source
# File lib/manageiq/loggers/base.rb, line 125
def call(severity, time, progname, msg)
  msg = prefix_task_id(msg2str(msg)).truncate(MAX_LOG_LINE_LENGTH)
  FORMAT % [severity[0..0], format_datetime(time), $PROCESS_ID, Thread.current.object_id, severity, progname, msg]
end

Private Instance Methods

prefix_task_id(msg) click to toggle source
# File lib/manageiq/loggers/base.rb, line 132
def prefix_task_id(msg)
  # Add task id to the message if a task is currently being worked on.
  if (task_id = (Thread.current["tracking_label"] || $_miq_worker_current_msg.try(:task_id)))
    prefix = "Q-task_id([#{task_id}])"
    msg = "#{prefix} #{msg}" unless msg.include?(prefix)
  end

  msg
end