class Inspec::BaseCLI
def configure_logger(o)
def configure_logger(o) # # TODO(ssd): This is a bit gross, but this configures the # logging singleton Inspec::Log. Eventually it would be nice to # move internal debug logging to use this logging singleton. # loc = if o['log_location'] o['log_location'] elsif suppress_log_output?(o) STDERR else STDOUT end Inspec::Log.init(loc) Inspec::Log.level = get_log_level(o['log_level']) o[:logger] = Logger.new(loc) # output json if we have activated the json formatter if o['log-format'] == 'json' o[:logger].formatter = Logger::JSONFormatter.new end o[:logger].level = get_log_level(o['log_level']) end