Class: OpinionatedHTTP::Logger
- Inherits:
-
Object
- Object
- OpinionatedHTTP::Logger
- Defined in:
- lib/opinionated_http/logger.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
- #<<(message) ⇒ Object
- #debug(*args, &block) ⇒ Object
- #error(*args, &block) ⇒ Object
- #info(*args, &block) ⇒ Object
-
#initialize(logger) ⇒ Logger
constructor
A new instance of Logger.
- #warn(*args, &block) ⇒ Object
Constructor Details
#initialize(logger) ⇒ Logger
Returns a new instance of Logger.
7 8 9 |
# File 'lib/opinionated_http/logger.rb', line 7 def initialize(logger) @logger = logger end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
5 6 7 |
# File 'lib/opinionated_http/logger.rb', line 5 def logger @logger end |
Instance Method Details
#<<(message) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/opinionated_http/logger.rb', line 11 def <<() return unless logger.trace? = .strip return if .blank? logger.trace() end |
#debug(*args, &block) ⇒ Object
20 21 22 |
# File 'lib/opinionated_http/logger.rb', line 20 def debug(*args, &block) logger.trace(*args, &block) end |
#error(*args, &block) ⇒ Object
32 33 34 |
# File 'lib/opinionated_http/logger.rb', line 32 def error(*args, &block) logger.error(*args, &block) end |
#info(*args, &block) ⇒ Object
24 25 26 |
# File 'lib/opinionated_http/logger.rb', line 24 def info(*args, &block) logger.info(*args, &block) end |
#warn(*args, &block) ⇒ Object
28 29 30 |
# File 'lib/opinionated_http/logger.rb', line 28 def warn(*args, &block) logger.warn(*args, &block) end |