Class: Dataflow::Logger
- Inherits:
-
Object
- Object
- Dataflow::Logger
- Defined in:
- lib/dataflow/logger.rb
Defined Under Namespace
Classes: LoggerImpl
Instance Attribute Summary collapse
-
#prefix ⇒ Object
Returns the value of attribute prefix.
-
#use_notifications ⇒ Object
Returns the value of attribute use_notifications.
Instance Method Summary collapse
-
#initialize(prefix:, use_notifications: false) ⇒ Logger
constructor
A new instance of Logger.
- #log(str) ⇒ Object
Constructor Details
#initialize(prefix:, use_notifications: false) ⇒ Logger
Returns a new instance of Logger.
7 8 9 10 11 |
# File 'lib/dataflow/logger.rb', line 7 def initialize(prefix:, use_notifications: false) @prefix = prefix @use_notifications = use_notifications @@impl = LoggerImpl.new end |
Instance Attribute Details
#prefix ⇒ Object
Returns the value of attribute prefix.
4 5 6 |
# File 'lib/dataflow/logger.rb', line 4 def prefix @prefix end |
#use_notifications ⇒ Object
Returns the value of attribute use_notifications.
5 6 7 |
# File 'lib/dataflow/logger.rb', line 5 def use_notifications @use_notifications end |
Instance Method Details
#log(str) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/dataflow/logger.rb', line 13 def log(str) return if ENV['RACK_ENV'] == 'test' now = DateTime.now.strftime('%y-%m-%d %H:%M:%S') = "[#{now}] #{prefix} :: #{str}" logger_impl = @@impl logger_impl.log() end |