Class: Code0::ZeroTrack::Loggable::Logger
- Inherits:
-
Object
- Object
- Code0::ZeroTrack::Loggable::Logger
- Defined in:
- lib/code0/zero_track/loggable.rb
Instance Method Summary collapse
- #debug(message) ⇒ Object
- #error(message) ⇒ Object
- #info(message) ⇒ Object
-
#initialize(log, clazz) ⇒ Logger
constructor
A new instance of Logger.
- #warn(message) ⇒ Object
- #with_context(&block) ⇒ Object
Constructor Details
#initialize(log, clazz) ⇒ Logger
Returns a new instance of Logger.
19 20 21 22 |
# File 'lib/code0/zero_track/loggable.rb', line 19 def initialize(log, clazz) @log = log @clazz = clazz end |
Instance Method Details
#debug(message) ⇒ Object
30 31 32 |
# File 'lib/code0/zero_track/loggable.rb', line 30 def debug() with_context { @log.debug() } end |
#error(message) ⇒ Object
34 35 36 |
# File 'lib/code0/zero_track/loggable.rb', line 34 def error() with_context { @log.error() } end |
#info(message) ⇒ Object
42 43 44 |
# File 'lib/code0/zero_track/loggable.rb', line 42 def info() with_context { @log.info() } end |
#warn(message) ⇒ Object
38 39 40 |
# File 'lib/code0/zero_track/loggable.rb', line 38 def warn() with_context { @log.warn() } end |
#with_context(&block) ⇒ Object
26 27 28 |
# File 'lib/code0/zero_track/loggable.rb', line 26 def with_context(&block) Code0::ZeroTrack::Context.with_context(class: @clazz, &block) end |