Class: HackyHAL::Log
- Inherits:
-
Logger
- Object
- Logger
- HackyHAL::Log
- Includes:
- Singleton
- Defined in:
- lib/hacky_hal/log.rb
Defined Under Namespace
Classes: Formatter
Instance Attribute Summary collapse
-
#enabled ⇒ Object
Returns the value of attribute enabled.
Instance Method Summary collapse
- #add(severity, message = nil, progname = nil, &block) ⇒ Object
- #add_without_enabled_switch ⇒ Object
-
#initialize ⇒ Log
constructor
A new instance of Log.
-
#write(string) ⇒ Object
for compatibility with Rack logger.
Constructor Details
Instance Attribute Details
#enabled ⇒ Object
Returns the value of attribute enabled.
8 9 10 |
# File 'lib/hacky_hal/log.rb', line 8 def enabled @enabled end |
Instance Method Details
#add(severity, message = nil, progname = nil, &block) ⇒ Object
24 25 26 |
# File 'lib/hacky_hal/log.rb', line 24 def add(severity, = nil, progname = nil, &block) add_without_enabled_switch(severity, , progname, &block) if enabled end |
#add_without_enabled_switch ⇒ Object
23 |
# File 'lib/hacky_hal/log.rb', line 23 alias_method :add_without_enabled_switch, :add |
#write(string) ⇒ Object
for compatibility with Rack logger
29 30 31 |
# File 'lib/hacky_hal/log.rb', line 29 def write(string) self << string end |