Class: KPM::TraceLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/kpm/trace_logger.rb

Instance Method Summary collapse

Constructor Details

#initializeTraceLogger

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, message)
  add_to_hash(group,key,message);
end

#to_hashObject

Return HASH representation of the logs



20
21
22
# File 'lib/kpm/trace_logger.rb', line 20

def to_hash
  @trace
end

#to_jsonObject

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_sObject

Return String representation of the logs



15
16
17
# File 'lib/kpm/trace_logger.rb', line 15

def to_s
  @trace.to_s
end