Class: KPM::TraceLogger
- Inherits:
-
Object
- Object
- KPM::TraceLogger
- Defined in:
- lib/kpm/trace_logger.rb
Instance Method Summary collapse
- #add(group = nil, key, message) ⇒ Object
-
#initialize ⇒ TraceLogger
constructor
A new instance of TraceLogger.
-
#to_hash ⇒ Object
Return HASH representation of the logs.
-
#to_json ⇒ 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.
5 6 7 |
# File 'lib/kpm/trace_logger.rb', line 5 def initialize @trace = Hash.new end |
Instance Method Details
#add(group = nil, key, message) ⇒ Object
24 25 26 |
# File 'lib/kpm/trace_logger.rb', line 24 def add(group=nil, key, ) add_to_hash(group,key,); end |
#to_hash ⇒ Object
Return HASH representation of the logs
20 21 22 |
# File 'lib/kpm/trace_logger.rb', line 20 def to_hash @trace end |
#to_json ⇒ Object
Return JSON representation of the logs
10 11 12 |
# File 'lib/kpm/trace_logger.rb', line 10 def to_json @trace.to_json end |
#to_s ⇒ Object
Return String representation of the logs
15 16 17 |
# File 'lib/kpm/trace_logger.rb', line 15 def to_s @trace.to_s end |