Module: DevSuite::MethodTracer::Logger

Defined in:
lib/dev_suite/method_tracer/logger.rb

Class Method Summary collapse

Class Method Details

.log_method_call(tp, tracer) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/dev_suite/method_tracer/logger.rb', line 7

def log_method_call(tp, tracer)
  # Store the start time for execution time calculation
  tracer.start_times[tp.method_id] = Time.now

  message = build_call_message(tp, tracer)
  Utils::Logger.log(message, emoji: :start, color: :blue)
end

.log_method_return(tp, tracer) ⇒ Object



15
16
17
18
19
20
# File 'lib/dev_suite/method_tracer/logger.rb', line 15

def log_method_return(tp, tracer)
  duration = Helpers.calculate_duration(tp, tracer.start_times)

  message = build_return_message(tp, tracer, duration)
  Utils::Logger.log(message, emoji: :finish, color: :cyan)
end