Class: Rack::Bug::LogPanel::LogEntry

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

Constant Summary collapse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(level, time, message) ⇒ LogEntry

Returns a new instance of LogEntry.



11
12
13
14
15
# File 'lib/rack/bug/panels/log_panel.rb', line 11

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

Instance Attribute Details

#levelObject (readonly)

Returns the value of attribute level.



8
9
10
# File 'lib/rack/bug/panels/log_panel.rb', line 8

def level
  @level
end

#messageObject (readonly)

Returns the value of attribute message.



8
9
10
# File 'lib/rack/bug/panels/log_panel.rb', line 8

def message
  @message
end

#timeObject (readonly)

Returns the value of attribute time.



8
9
10
# File 'lib/rack/bug/panels/log_panel.rb', line 8

def time
  @time
end

Instance Method Details

#cleaned_messageObject



17
18
19
# File 'lib/rack/bug/panels/log_panel.rb', line 17

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