module Consul::Template::Generator::STDLogger

Public Class Methods

debug(msg) click to toggle source
# File lib/consul/template/generator/configuration.rb, line 21
def debug(msg)
  if do_log?(:debug, Consul::Template::Generator.config.log_level)
    STDOUT.puts "[DEBUG] #{msg}"
  end
end
do_log?(requested_lvl, curr_lvl) click to toggle source
# File lib/consul/template/generator/configuration.rb, line 15
def do_log?(requested_lvl, curr_lvl)
  curr_lvl = Consul::Template::Generator::STDLogLvl.send(curr_lvl.to_sym)
  requested_lvl = Consul::Template::Generator::STDLogLvl.send(requested_lvl.to_sym)
  requested_lvl >= curr_lvl
end
error(msg) click to toggle source
# File lib/consul/template/generator/configuration.rb, line 33
def error(msg)
  if do_log?(:error, Consul::Template::Generator.config.log_level)
    STDERR.puts "[ERROR] #{msg}"
  end
end
info(msg) click to toggle source
# File lib/consul/template/generator/configuration.rb, line 27
def info(msg)
  if do_log?(:info, Consul::Template::Generator.config.log_level)
    STDOUT.puts "[INFO] #{msg}"
  end
end