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.



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

#to_hashObject

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_sObject

Return String representation of the logs



17
18
19
# File 'lib/kpm/trace_logger.rb', line 17

def to_s
  @trace.to_s
end