Sha256: 46ebaac4eb11b2a23a27fc9fd9d5db5f0e3ae6addf5e76b42470883a81947374
Contents?: true
Size: 409 Bytes
Versions: 13
Compression:
Stored size: 409 Bytes
Contents
# Wraps another logger and tags output. class LogTagger LOGGER_METHODS = [:debug, :error, :fatal, :info, :unknown, :warn] attr_accessor :tag, :logger def initialize(tag, logger) self.tag = tag self.logger = logger end def method_missing(method, *args) if LOGGER_METHODS.include?(method) logger.send(method, "[#{tag}] #{args.first}") else super end end end
Version data entries
13 entries across 13 versions & 1 rubygems