Class: DebugLogging::LambDart::Log
- Defined in:
- lib/debug_logging/lamb_dart/log.rb
Instance Attribute Summary collapse
-
#invocation_id ⇒ Object
readonly
Returns the value of attribute invocation_id.
-
#log_prefix ⇒ Object
readonly
Returns the value of attribute log_prefix.
-
#start_at ⇒ Object
readonly
Returns the value of attribute start_at.
Attributes inherited from Base
#args, #config_proxy, #decorated_method, #instance, #is_class, #klass, #kwargs, #method_payload, #scope_term
Instance Method Summary collapse
- #bench? ⇒ Boolean
- #bench_scope ⇒ Object
- #benchmarked(tms) ⇒ Object
- #end_timestamp ⇒ Object
-
#initialize ⇒ Log
constructor
A new instance of Log.
- #mark_exit_scope? ⇒ Boolean
Constructor Details
#initialize ⇒ Log
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_id ⇒ Object (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_prefix ⇒ Object (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_at ⇒ Object (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
36 37 38 |
# File 'lib/debug_logging/lamb_dart/log.rb', line 36 def bench? config_proxy.benchmarkable_for?(bench_scope) end |
#bench_scope ⇒ Object
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_timestamp ⇒ Object
20 21 22 |
# File 'lib/debug_logging/lamb_dart/log.rb', line 20 def klass.debug_time_to_s(Time.now, config_proxy:) end |
#mark_exit_scope? ⇒ 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 |