Class: GoogleDistanceMatrix::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/google_distance_matrix/logger.rb

Overview

Logger class for Google Distance Matrix

Constant Summary collapse

PREFIXES =
%w[google_distance_matrix].freeze
LEVELS =
%w[fatal error warn info debug].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(backend = nil) ⇒ Logger

Returns a new instance of Logger.



11
12
13
# File 'lib/google_distance_matrix/logger.rb', line 11

def initialize(backend = nil)
  @backend = backend
end

Instance Attribute Details

#backendObject (readonly)

Returns the value of attribute backend.



9
10
11
# File 'lib/google_distance_matrix/logger.rb', line 9

def backend
  @backend
end

Instance Method Details

#levelObject



26
27
28
# File 'lib/google_distance_matrix/logger.rb', line 26

def level
  backend&.level || 1
end