Class: Ingenico::Connect::SDK::Logging::StdoutCommunicatorLogger
- Inherits:
-
CommunicatorLogger
- Object
- CommunicatorLogger
- Ingenico::Connect::SDK::Logging::StdoutCommunicatorLogger
- 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 ⇒ Object
Returns the StdoutCommunicatorLogger instance.
Instance Method Summary collapse
-
#initialize ⇒ StdoutCommunicatorLogger
constructor
A new instance of StdoutCommunicatorLogger.
-
#log(msg, thrown = false) ⇒ Object
Logs a single error or non-error message to $stdout.
Constructor Details
#initialize ⇒ StdoutCommunicatorLogger
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
.INSTANCE ⇒ Object
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 |