Class: CubaApi::Logger
- Inherits:
-
Object
- Object
- CubaApi::Logger
- Defined in:
- lib/cuba_api/loggers.rb
Instance Method Summary collapse
- #debug(&block) ⇒ Object
- #error(&block) ⇒ Object
- #info(&block) ⇒ Object
-
#initialize(cat = 'ROOT', level = 1) ⇒ Logger
constructor
A new instance of Logger.
- #warn(&block) ⇒ Object
Constructor Details
#initialize(cat = 'ROOT', level = 1) ⇒ Logger
Returns a new instance of Logger.
56 57 58 59 |
# File 'lib/cuba_api/loggers.rb', line 56 def initialize( cat = 'ROOT', level = 1 ) @level = ( level || 1 ).to_i @cat = cat end |
Instance Method Details
#debug(&block) ⇒ Object
61 62 63 |
# File 'lib/cuba_api/loggers.rb', line 61 def debug( &block ) do_puts( 0, &block ) end |
#error(&block) ⇒ Object
73 74 75 |
# File 'lib/cuba_api/loggers.rb', line 73 def error( &block ) do_warn( 3, &block ) end |
#info(&block) ⇒ Object
65 66 67 |
# File 'lib/cuba_api/loggers.rb', line 65 def info( &block ) do_puts( 1, &block ) end |
#warn(&block) ⇒ Object
69 70 71 |
# File 'lib/cuba_api/loggers.rb', line 69 def warn( &block ) do_warn( 2, &block ) end |