Sha256: 6c9bc3f784ae8fb216406497f7c9425a9dd0e6b5e0f3768e8069e1b596430971
Contents?: true
Size: 1.34 KB
Versions: 5
Compression:
Stored size: 1.34 KB
Contents
module Ougai # A logger created by the `child` method of parent logger class ChildLogger include Logging # @private def initialize(parent, fields) @parent = parent @with_fields = fields end def level @parent.level end # Whether the current severity level allows for logging DEBUG. # @return [Boolean] true if allows def debug? @parent.debug? end # Whether the current severity level allows for logging INFO. # @return [Boolean] true if allows def info? @parent.info? end # Whether the current severity level allows for logging WARN. # @return [Boolean] true if allows def warn? @parent.warn? end # Whether the current severity level allows for logging ERROR. # @return [Boolean] true if allows def error? @parent.error? end # Whether the current severity level allows for logging FATAL. # @return [Boolean] true if allows def fatal? @parent.fatal? end # @private def chain(severity, args, fields, hooks) hooks.push(@before_log) if @before_log @parent.chain(severity, args, merge_fields(@with_fields, fields), hooks) end protected def append(severity, args) hooks = @before_log ? [@before_log] : [] @parent.chain(severity, args, @with_fields, hooks) end end end
Version data entries
5 entries across 5 versions & 1 rubygems