Class: DebugLogging::LambDart::Log

Inherits:
Base
  • Object
show all
Defined in:
lib/debug_logging/lamb_dart/log.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#args, #config_proxy, #decorated_method, #instance, #is_class, #klass, #kwargs, #method_payload, #scope_term

Instance Method Summary collapse

Constructor Details

#initializeLog

Returns a new instance of Log.



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/debug_logging/lamb_dart/log.rb', line 8

def initialize(...)
  @start_at = Time.now
  super
  @log_prefix = klass.debug_invocation_to_s(
    klass: klass.to_s,
    separator: is_class ? "::" : "#",
    decorated_method:,
    config_proxy:,
  )
  @invocation_id = klass.debug_invocation_id_to_s(args:, config_proxy:)
end

Instance Attribute Details

#invocation_idObject (readonly)

Returns the value of attribute invocation_id.



4
5
6
# File 'lib/debug_logging/lamb_dart/log.rb', line 4

def invocation_id
  @invocation_id
end

#log_prefixObject (readonly)

Returns the value of attribute log_prefix.



4
5
6
# File 'lib/debug_logging/lamb_dart/log.rb', line 4

def log_prefix
  @log_prefix
end

#start_atObject (readonly)

Returns the value of attribute start_at.



4
5
6
# File 'lib/debug_logging/lamb_dart/log.rb', line 4

def start_at
  @start_at
end

Instance Method Details

#bench?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/debug_logging/lamb_dart/log.rb', line 36

def bench?
  config_proxy.benchmarkable_for?(bench_scope)
end

#bench_scopeObject



32
33
34
# File 'lib/debug_logging/lamb_dart/log.rb', line 32

def bench_scope
  "debug_#{scope_term}_benchmarks".to_sym
end

#benchmarked(tms) ⇒ Object



24
25
26
# File 'lib/debug_logging/lamb_dart/log.rb', line 24

def benchmarked(tms)
  klass.debug_benchmark_to_s(tms: tms)
end

#end_timestampObject



20
21
22
# File 'lib/debug_logging/lamb_dart/log.rb', line 20

def end_timestamp
  klass.debug_time_to_s(Time.now, config_proxy:)
end

#mark_exit_scope?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/debug_logging/lamb_dart/log.rb', line 28

def mark_exit_scope?
  config_proxy.exit_scope_markable? && invocation_id && !invocation_id.empty?
end