Class: Ougai::ChildLogger
- Inherits:
-
Object
- Object
- Ougai::ChildLogger
- Includes:
- Logging
- Defined in:
- lib/ougai/child_logger.rb
Overview
A logger created by the ‘child` method of parent logger
Constant Summary
Constants included from Logging::Severity
Logging::Severity::SEV_LABEL, Logging::Severity::TRACE
Instance Attribute Summary
Attributes included from Logging
Instance Method Summary collapse
- #chain(severity, args, fields, hooks) ⇒ Object
-
#debug? ⇒ Boolean
Whether the current severity level allows for logging DEBUG.
-
#error? ⇒ Boolean
Whether the current severity level allows for logging ERROR.
-
#fatal? ⇒ Boolean
Whether the current severity level allows for logging FATAL.
-
#info? ⇒ Boolean
Whether the current severity level allows for logging INFO.
-
#initialize(parent, fields) ⇒ ChildLogger
constructor
A new instance of ChildLogger.
- #level ⇒ Object
-
#warn? ⇒ Boolean
Whether the current severity level allows for logging WARN.
Methods included from Logging
#child, #debug, #error, #fatal, #info, #trace, #trace?, #unknown, #warn
Methods included from Logging::Severity
Constructor Details
#initialize(parent, fields) ⇒ ChildLogger
Returns a new instance of ChildLogger.
7 8 9 10 |
# File 'lib/ougai/child_logger.rb', line 7 def initialize(parent, fields) @parent = parent @with_fields = fields end |
Instance Method Details
#chain(severity, args, fields, hooks) ⇒ Object
47 48 49 50 |
# File 'lib/ougai/child_logger.rb', line 47 def chain(severity, args, fields, hooks) hooks.push(@before_log) if @before_log @parent.chain(severity, args, weak_merge!(fields, @with_fields), hooks) end |
#debug? ⇒ Boolean
Whether the current severity level allows for logging DEBUG.
18 19 20 |
# File 'lib/ougai/child_logger.rb', line 18 def debug? @parent.debug? end |
#error? ⇒ Boolean
Whether the current severity level allows for logging ERROR.
36 37 38 |
# File 'lib/ougai/child_logger.rb', line 36 def error? @parent.error? end |
#fatal? ⇒ Boolean
Whether the current severity level allows for logging FATAL.
42 43 44 |
# File 'lib/ougai/child_logger.rb', line 42 def fatal? @parent.fatal? end |
#info? ⇒ Boolean
Whether the current severity level allows for logging INFO.
24 25 26 |
# File 'lib/ougai/child_logger.rb', line 24 def info? @parent.info? end |
#level ⇒ Object
12 13 14 |
# File 'lib/ougai/child_logger.rb', line 12 def level @parent.level end |
#warn? ⇒ Boolean
Whether the current severity level allows for logging WARN.
30 31 32 |
# File 'lib/ougai/child_logger.rb', line 30 def warn? @parent.warn? end |