Module: GoFlippy::Logger
- Included in:
- Client, Config, HttpClient, Poller, Worker
- Defined in:
- lib/goflippy-ruby/logger.rb
Constant Summary collapse
- MESSAGE_PREFIX =
'[GoFippy]'
Class Method Summary collapse
- .debug(message) ⇒ Object
- .error(message) ⇒ Object
- .fatal(message) ⇒ Object
- .info(message) ⇒ Object
- .logger ⇒ Object
- .logger=(logger) ⇒ Object
- .unknown(message) ⇒ Object
- .warn(message) ⇒ Object
Class Method Details
.debug(message) ⇒ Object
17 18 19 |
# File 'lib/goflippy-ruby/logger.rb', line 17 def self.debug() self.logger.debug("#{MESSAGE_PREFIX} #{}") end |
.error(message) ⇒ Object
29 30 31 |
# File 'lib/goflippy-ruby/logger.rb', line 29 def self.error() self.logger.error("#{MESSAGE_PREFIX} #{}") end |
.fatal(message) ⇒ Object
33 34 35 |
# File 'lib/goflippy-ruby/logger.rb', line 33 def self.fatal() self.logger.fatal("#{MESSAGE_PREFIX} #{}") end |
.info(message) ⇒ Object
21 22 23 |
# File 'lib/goflippy-ruby/logger.rb', line 21 def self.info() self.logger.info("#{MESSAGE_PREFIX} #{}") end |
.logger ⇒ Object
7 8 9 10 11 |
# File 'lib/goflippy-ruby/logger.rb', line 7 def self.logger @logger ||= defined?(Rails) && Rails.respond_to?(:logger) ? Rails.logger : ::Logger.new($stdout, level: ::Logger::DEBUG) end |
.logger=(logger) ⇒ Object
13 14 15 |
# File 'lib/goflippy-ruby/logger.rb', line 13 def self.logger=(logger) @logger = logger end |
.unknown(message) ⇒ Object
37 38 39 |
# File 'lib/goflippy-ruby/logger.rb', line 37 def self.unknown() self.logger.unknown("#{MESSAGE_PREFIX} #{}") end |
.warn(message) ⇒ Object
25 26 27 |
# File 'lib/goflippy-ruby/logger.rb', line 25 def self.warn() self.logger.warn("#{MESSAGE_PREFIX} #{}") end |