Class: Temporal::Workflow::ReplayAwareLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/temporal/workflow/replay_aware_logger.rb

Constant Summary collapse

SEVERITIES =
%i[debug info warn error fatal unknown].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(main_logger, replay = true) ⇒ ReplayAwareLogger

Returns a new instance of ReplayAwareLogger.



8
9
10
11
# File 'lib/temporal/workflow/replay_aware_logger.rb', line 8

def initialize(main_logger, replay = true)
  @main_logger = main_logger
  @replay = replay
end

Instance Attribute Details

#replay=(value) ⇒ Object (writeonly)

Sets the attribute replay

Parameters:

  • value

    the value to set the attribute replay to.



6
7
8
# File 'lib/temporal/workflow/replay_aware_logger.rb', line 6

def replay=(value)
  @replay = value
end

Instance Method Details

#log(severity, message, data = {}) ⇒ Object



21
22
23
24
25
# File 'lib/temporal/workflow/replay_aware_logger.rb', line 21

def log(severity, message, data = {})
  return if replay?

  main_logger.log(severity, message, data)
end