Module: Loggability::LogHost
- Included in:
- Loggability
- Defined in:
- lib/loggability/loghost.rb
Overview
Extension for ‘log hosts’. A log host is an object that hosts a Loggability::Logger object, and is typically the top of some kind of hierarchy, like a namespace module for a project:
module MyProject
end
This module isn’t mean to be used directly – it’s installed via the Loggability#log_as declaration, which also does some other initialization that you’ll likely want.
Instance Attribute Summary collapse
-
#default_logger ⇒ Object
The logger that will be used when the logging subsystem is reset.
-
#log_host_key ⇒ Object
The key associated with the logger for this host.
-
#logger ⇒ Object
(also: #log)
The logger that’s currently in effect.
Instance Method Summary collapse
-
#inherited(subclass) ⇒ Object
Make subclasses log clients of the loghost.
Instance Attribute Details
#default_logger ⇒ Object
The logger that will be used when the logging subsystem is reset
22 23 24 |
# File 'lib/loggability/loghost.rb', line 22 def default_logger @default_logger end |
#log_host_key ⇒ Object
The key associated with the logger for this host
29 30 31 |
# File 'lib/loggability/loghost.rb', line 29 def log_host_key @log_host_key end |
#logger ⇒ Object Also known as: log
The logger that’s currently in effect
25 26 27 |
# File 'lib/loggability/loghost.rb', line 25 def logger @logger end |
Instance Method Details
#inherited(subclass) ⇒ Object
Make subclasses log clients of the loghost.
41 42 43 44 |
# File 'lib/loggability/loghost.rb', line 41 def inherited( subclass ) super subclass.log_to( self ) end |