Class: Centralpos::Core::Logger
- Inherits:
-
Object
- Object
- Centralpos::Core::Logger
- Defined in:
- lib/centralpos/core/logger.rb
Instance Attribute Summary collapse
-
#log ⇒ Object
Returns the value of attribute log.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#pretty_print_xml ⇒ Object
Returns the value of attribute pretty_print_xml.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Logger
constructor
Receives a hash with keys ‘log`, `pretty_print_xml` and `log_level`.
-
#logger_options ⇒ Hash
Returns a hash with the logging options for Savon.
Constructor Details
#initialize(opts = {}) ⇒ Logger
Receives a hash with keys ‘log`, `pretty_print_xml` and `log_level`. `log_level` can be :info, :debug, :warn, :error or :fatal
13 14 15 16 17 |
# File 'lib/centralpos/core/logger.rb', line 13 def initialize(opts = {}) @log = opts[:log] || false @pretty_print_xml = opts[:pretty_print_xml] || false @log_level = opts[:log_level] || :info end |
Instance Attribute Details
#log ⇒ Object
Returns the value of attribute log.
4 5 6 |
# File 'lib/centralpos/core/logger.rb', line 4 def log @log end |
#log_level ⇒ Object
Returns the value of attribute log_level.
4 5 6 |
# File 'lib/centralpos/core/logger.rb', line 4 def log_level @log_level end |
#pretty_print_xml ⇒ Object
Returns the value of attribute pretty_print_xml.
4 5 6 |
# File 'lib/centralpos/core/logger.rb', line 4 def pretty_print_xml @pretty_print_xml end |
Class Method Details
.options ⇒ Object
30 31 32 33 |
# File 'lib/centralpos/core/logger.rb', line 30 def self. @logger ||= Centralpos::Core::Logger.new @logger. end |
.options=(opts = {}) ⇒ Object
26 27 28 |
# File 'lib/centralpos/core/logger.rb', line 26 def self.(opts = {}) @logger = Centralpos::Core::Logger.new(opts) end |
Instance Method Details
#logger_options ⇒ Hash
Returns a hash with the logging options for Savon.
22 23 24 |
# File 'lib/centralpos/core/logger.rb', line 22 def { log: log, pretty_print_xml: pretty_print_xml, log_level: log_level } end |