Class: Ingenico::Direct::SDK::Logging::StdoutCommunicatorLogger

Inherits:
CommunicatorLogger show all
Includes:
Singleton
Defined in:
lib/ingenico/direct/sdk/logging/stdout_communicator_logger.rb

Overview

CommunicatorLogger that logs the messages to $stdout.

Instance Method Summary collapse

Constructor Details

#initializeStdoutCommunicatorLogger

Returns a new instance of StdoutCommunicatorLogger.



11
12
13
# File 'lib/ingenico/direct/sdk/logging/stdout_communicator_logger.rb', line 11

def initialize
  # implement the interface
end

Instance Method Details

#log(msg, thrown = nil) ⇒ Object

Logs a single error or non-error message to $stdout.



21
22
23
24
25
# File 'lib/ingenico/direct/sdk/logging/stdout_communicator_logger.rb', line 21

def log(msg, thrown = nil)
  $stdout.puts get_date_prefix + msg
  $stdout.puts thrown.to_s if thrown
  $stdout.puts thrown.backtrace.join($RS) if thrown
end