Class: FHTTPClient::Logger::Default
- Inherits:
-
Object
- Object
- FHTTPClient::Logger::Default
- Defined in:
- lib/f_http_client/logger/default.rb
Overview
A Basic logger to use when no logger is provided
Instance Method Summary collapse
- #debug(message) ⇒ Object
- #error(message) ⇒ Object
- #fatal(message) ⇒ Object
- #info(message) ⇒ Object
-
#initialize(tags: []) ⇒ Default
constructor
A new instance of Default.
- #tagged(*tags) ⇒ Object
- #unknown(message) ⇒ Object
- #warn(message) ⇒ Object
Constructor Details
#initialize(tags: []) ⇒ Default
Returns a new instance of Default.
7 8 9 10 |
# File 'lib/f_http_client/logger/default.rb', line 7 def initialize(tags: []) @logger = ::Logger.new($stdout) @current_tags = end |
Instance Method Details
#debug(message) ⇒ Object
17 |
# File 'lib/f_http_client/logger/default.rb', line 17 def debug() = add(::Logger::DEBUG, ) |
#error(message) ⇒ Object
20 |
# File 'lib/f_http_client/logger/default.rb', line 20 def error() = add(::Logger::ERROR, ) |
#fatal(message) ⇒ Object
21 |
# File 'lib/f_http_client/logger/default.rb', line 21 def fatal() = add(::Logger::FATAL, ) |
#info(message) ⇒ Object
18 |
# File 'lib/f_http_client/logger/default.rb', line 18 def info() = add(::Logger::INFO, ) |
#tagged(*tags) ⇒ Object
12 13 14 15 |
# File 'lib/f_http_client/logger/default.rb', line 12 def tagged(*) tagged = self.class.new(tags: + ) block_given? ? yield(tagged) : tagged end |
#unknown(message) ⇒ Object
22 |
# File 'lib/f_http_client/logger/default.rb', line 22 def unknown() = add(::Logger::UNKNOWN, ) |
#warn(message) ⇒ Object
19 |
# File 'lib/f_http_client/logger/default.rb', line 19 def warn() = add(::Logger::WARN, ) |