Class: Kernai::Logger
- Inherits:
-
Object
- Object
- Kernai::Logger
- Defined in:
- lib/kernai/logger.rb
Instance Attribute Summary collapse
-
#output ⇒ Object
Returns the value of attribute output.
Instance Method Summary collapse
- #debug(message = nil, **data) ⇒ Object
- #error(message = nil, **data) ⇒ Object
- #info(message = nil, **data) ⇒ Object
-
#initialize(output = $stdout) ⇒ Logger
constructor
A new instance of Logger.
- #warn(message = nil, **data) ⇒ Object
Constructor Details
#initialize(output = $stdout) ⇒ Logger
Returns a new instance of Logger.
7 8 9 |
# File 'lib/kernai/logger.rb', line 7 def initialize(output = $stdout) @output = output end |
Instance Attribute Details
#output ⇒ Object
Returns the value of attribute output.
5 6 7 |
# File 'lib/kernai/logger.rb', line 5 def output @output end |
Instance Method Details
#debug(message = nil, **data) ⇒ Object
11 12 13 |
# File 'lib/kernai/logger.rb', line 11 def debug( = nil, **data) log(:DEBUG, , **data) end |
#error(message = nil, **data) ⇒ Object
23 24 25 |
# File 'lib/kernai/logger.rb', line 23 def error( = nil, **data) log(:ERROR, , **data) end |
#info(message = nil, **data) ⇒ Object
15 16 17 |
# File 'lib/kernai/logger.rb', line 15 def info( = nil, **data) log(:INFO, , **data) end |
#warn(message = nil, **data) ⇒ Object
19 20 21 |
# File 'lib/kernai/logger.rb', line 19 def warn( = nil, **data) log(:WARN, , **data) end |