Sha256: 45965525cbe1f1fa3b1b417de4ea735bc33a0ae8d7c715a3c285bd84ccd6387b
Contents?: true
Size: 742 Bytes
Versions: 60
Compression:
Stored size: 742 Bytes
Contents
# frozen_string_literal: true require 'log4r/outputter/outputter' module Bolt class R10KLogProxy < Log4r::Outputter def initialize super('bolt') @logger = Bolt::Logger.logger(self) end def canonical_log(event) level = to_bolt_level(event.level) @logger.send(level, event.data) end # Convert an r10k log level to a bolt log level. These correspond 1-to-1 # except that r10k has debug, debug1, and debug2. The log event has the log # level as an integer that we need to look up. def to_bolt_level(level_num) level_str = Log4r::LNAMES[level_num]&.downcase || 'debug' if level_str =~ /debug/ :debug else level_str.to_sym end end end end
Version data entries
60 entries across 60 versions & 1 rubygems