module Legion module Logging module Builder def log_format(_options = {}, log = @log) log.formatter = proc do |severity, datetime, _progname, msg| "[#{datetime}][#{::Process.pid}] #{severity} #{msg}\n" end end def output(options) @log = ::Logger.new($stdout) if options[:log_file].nil? @log = ::Logger.new(options[:log_file]) unless options[:log_file].nil? end def log_level(level = 'debug', log = @log) if level == 'debug' log.level = ::Logger::DEBUG elsif level == 'info' log.level = ::Logger::INFO elsif level == 'warn' log.level = ::Logger::WARN elsif level == 'error' log.level = ::Logger::ERROR elsif level == 'fatal' log.level = ::Logger::FATAL end @log = log end end end end