class Flor::TransientExecutor::TransientLogger

Public Class Methods

new(unit) click to toggle source
# File lib/flor/core/texecutor.rb, line 46
def initialize(unit)

  @unit = unit

  @out = Flor::Logger::Out.prepare(unit)
end

Public Instance Methods

log_err(executor, message, opts={}) click to toggle source
# File lib/flor/core/texecutor.rb, line 61
def log_err(executor, message, opts={})

  return unless @unit.conf['log_err']

  @out.puts(
    Flor.msg_to_detail_s(executor, message, opts.merge(flag: true)))
end
log_src(source, opts, log_opts={}) click to toggle source
# File lib/flor/core/texecutor.rb, line 69
def log_src(source, opts, log_opts={})

  return unless @unit.conf['log_src']

  @out.puts(Flor.src_to_s(source, opts, log_opts))
end
log_tree(tree, nid='0', opts={}) click to toggle source
# File lib/flor/core/texecutor.rb, line 76
def log_tree(tree, nid='0', opts={})

  return unless @unit.conf['log_tree']

  @out.puts(Flor.tree_to_s(tree, nid, opts.merge(out: @out)))
end
notify(executor, message) click to toggle source
# File lib/flor/core/texecutor.rb, line 53
def notify(executor, message)

  return if message['point'] == 'end'
  return unless @unit.conf['log_msg']

  @out.puts(Flor.message_to_one_line_s(executor, message, out: @out))
end