Class: LogEntry
- Inherits:
-
Object
- Object
- LogEntry
- Defined in:
- lib/log_query/log_entry.rb
Constant Summary collapse
- LOG_PARSER =
/^(?<timestamp>[^\s]+) (?<source>[^\[]+)\[(?<dyno>[^\]]+)\]: (?<message>.*)$/
Instance Attribute Summary collapse
-
#dyno ⇒ Object
Returns the value of attribute dyno.
-
#message ⇒ Object
Returns the value of attribute message.
-
#source ⇒ Object
Returns the value of attribute source.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(timestamp, source, dyno, message) ⇒ LogEntry
constructor
A new instance of LogEntry.
Constructor Details
Instance Attribute Details
#dyno ⇒ Object
Returns the value of attribute dyno.
4 5 6 |
# File 'lib/log_query/log_entry.rb', line 4 def dyno @dyno end |
#message ⇒ Object
Returns the value of attribute message.
4 5 6 |
# File 'lib/log_query/log_entry.rb', line 4 def @message end |
#source ⇒ Object
Returns the value of attribute source.
4 5 6 |
# File 'lib/log_query/log_entry.rb', line 4 def source @source end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
4 5 6 |
# File 'lib/log_query/log_entry.rb', line 4 def @timestamp end |
Class Method Details
.from_heroku_log_line(line) ⇒ Object
8 9 10 11 |
# File 'lib/log_query/log_entry.rb', line 8 def self.from_heroku_log_line(line) matches = line.match(LOG_PARSER) new(matches[:timestamp], matches[:source], matches[:dyno], matches[:message]) end |