Class: Ingenico::Connect::SDK::Logging::StdoutCommunicatorLogger

Inherits:
CommunicatorLogger show all
Defined in:
lib/ingenico/connect/sdk/logging/stdout_communicator_logger.rb

Overview

CommunicatorLogger that logs the messages to $stdout.

Constant Summary collapse

@@INSTANCE =

singleton

StdoutCommunicatorLogger.new

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStdoutCommunicatorLogger

Returns a new instance of StdoutCommunicatorLogger.



9
10
11
# File 'lib/ingenico/connect/sdk/logging/stdout_communicator_logger.rb', line 9

def initialize
  # implement the interface
end

Class Method Details

.INSTANCEObject

Returns the StdoutCommunicatorLogger instance



19
20
21
# File 'lib/ingenico/connect/sdk/logging/stdout_communicator_logger.rb', line 19

def self.INSTANCE
  @@INSTANCE
end

Instance Method Details

#log(msg, thrown = false) ⇒ Object

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



24
25
26
27
# File 'lib/ingenico/connect/sdk/logging/stdout_communicator_logger.rb', line 24

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