Class: KPM::TraceLogger
- Inherits:
-
Object
- Object
- KPM::TraceLogger
- Defined in:
- lib/kpm/trace_logger.rb
Instance Method Summary collapse
- #add(group, key, message) ⇒ Object
-
#initialize ⇒ TraceLogger
constructor
A new instance of TraceLogger.
-
#to_hash ⇒ Object
Return HASH representation of the logs.
-
#to_json(*_args) ⇒ Object
Return JSON representation of the logs.
-
#to_s ⇒ Object
Return String representation of the logs.
Constructor Details
#initialize ⇒ TraceLogger
Returns a new instance of TraceLogger.
7 8 9 |
# File 'lib/kpm/trace_logger.rb', line 7 def initialize @trace = {} end |
Instance Method Details
#add(group, key, message) ⇒ Object
26 27 28 |
# File 'lib/kpm/trace_logger.rb', line 26 def add(group, key, ) add_to_hash(group, key, ) end |
#to_hash ⇒ Object
Return HASH representation of the logs
22 23 24 |
# File 'lib/kpm/trace_logger.rb', line 22 def to_hash @trace end |
#to_json(*_args) ⇒ Object
Return JSON representation of the logs
12 13 14 |
# File 'lib/kpm/trace_logger.rb', line 12 def to_json(*_args) @trace.to_json end |
#to_s ⇒ Object
Return String representation of the logs
17 18 19 |
# File 'lib/kpm/trace_logger.rb', line 17 def to_s @trace.to_s end |