Class: Purview::Loggers::Base
Direct Known Subclasses
Instance Method Summary collapse
- #debug(*args) ⇒ Object
- #error(*args) ⇒ Object
- #info(*args) ⇒ Object
-
#initialize(opts = {}) ⇒ Base
constructor
A new instance of Base.
- #with_context_logging(*args) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Base
Returns a new instance of Base.
4 5 6 |
# File 'lib/purview/loggers/base.rb', line 4 def initialize(opts={}) @opts = default_opts.merge(opts) end |
Instance Method Details
#debug(*args) ⇒ Object
8 9 10 |
# File 'lib/purview/loggers/base.rb', line 8 def debug(*args) log(DEBUG_LEVEL, *args) if debug? end |
#error(*args) ⇒ Object
12 13 14 |
# File 'lib/purview/loggers/base.rb', line 12 def error(*args) log(ERROR_LEVEL, *args) if error? end |
#info(*args) ⇒ Object
16 17 18 |
# File 'lib/purview/loggers/base.rb', line 16 def info(*args) log(INFO_LEVEL, *args) if info? end |
#with_context_logging(*args) ⇒ Object
20 21 22 23 |
# File 'lib/purview/loggers/base.rb', line 20 def with_context_logging(*args) debug((*args)) yield.tap { |result| debug((*args)) } end |