Sha256: 36a0a0a0a6adae62b80aac44950e53c18bb34dad345a8a4e8b4676fde6215d90
Contents?: true
Size: 737 Bytes
Versions: 94
Compression:
Stored size: 737 Bytes
Contents
# frozen_string_literal: true require 'log4r/outputter/outputter' module Bolt class R10KLogProxy < Log4r::Outputter def initialize super('bolt') @logger = Logging.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
94 entries across 94 versions & 1 rubygems