Class: Insight::LogPanel::LogEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/insight/panels/log_panel.rb

Constant Summary

LEVELS =
['DEBUG', 'INFO', 'WARN', 'ERROR', 'FATAL']

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (LogEntry) initialize(level, time, message)

A new instance of LogEntry



7
8
9
10
11
# File 'lib/insight/panels/log_panel.rb', line 7

def initialize(level, time, message)
  @level = LEVELS[level]
  @time = time
  @message = message
end

Instance Attribute Details

- (Object) level (readonly)

Returns the value of attribute level



4
5
6
# File 'lib/insight/panels/log_panel.rb', line 4

def level
  @level
end

- (Object) message (readonly)

Returns the value of attribute message



4
5
6
# File 'lib/insight/panels/log_panel.rb', line 4

def message
  @message
end

- (Object) time (readonly)

Returns the value of attribute time



4
5
6
# File 'lib/insight/panels/log_panel.rb', line 4

def time
  @time
end

Instance Method Details

- (Object) cleaned_message



13
14
15
# File 'lib/insight/panels/log_panel.rb', line 13

def cleaned_message
  @message.to_s.gsub(/\e\[[;\d]+m/, "")
end