Class: Selenium::WebDriver::LogEntry

Inherits:
Object
  • Object
show all
Defined in:
rb/lib/selenium/webdriver/common/log_entry.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

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

Returns a new instance of LogEntry



6
7
8
9
10
# File 'rb/lib/selenium/webdriver/common/log_entry.rb', line 6

def initialize(level, timestamp, message)
  @level      = level
  @timestamp = timestamp
  @message    = message
end

Instance Attribute Details

- (Object) level (readonly)

Returns the value of attribute level



4
5
6
# File 'rb/lib/selenium/webdriver/common/log_entry.rb', line 4

def level
  @level
end

- (Object) message (readonly)

Returns the value of attribute message



4
5
6
# File 'rb/lib/selenium/webdriver/common/log_entry.rb', line 4

def message
  @message
end

- (Object) timestamp (readonly)

Returns the value of attribute timestamp



4
5
6
# File 'rb/lib/selenium/webdriver/common/log_entry.rb', line 4

def timestamp
  @timestamp
end

Instance Method Details

- (Object) as_json(opts = nil)



12
13
14
15
16
17
18
# File 'rb/lib/selenium/webdriver/common/log_entry.rb', line 12

def as_json(opts = nil)
  {
    'level'     => level,
    'timestamp' => timestamp,
    'message'   => message
  }
end

- (Object) time



24
25
26
# File 'rb/lib/selenium/webdriver/common/log_entry.rb', line 24

def time
  Time.at timestamp / 1000
end

- (Object) to_s



20
21
22
# File 'rb/lib/selenium/webdriver/common/log_entry.rb', line 20

def to_s
  "#{level} #{time}: #{message}"
end