/*
Copyright 2007-2011 Selenium committers

Portions copyright 2011 Software Freedom Conservancy

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
 */

package org.openqa.selenium.logging;

import java.util.logging.Level;

import org.json.JSONObject;

import com.google.common.collect.ImmutableMap;

/**
 * Represents a single log statement.
 */
public class LogEntry {
  private final Level level;
  private final long timestamp;
  private final String message;

  /**
   * @param level the level of the log, e.g. INFO.
   * @param timestamp long value of the timestamp at which this log entry
   *     was created.
   * @param message String the log's message.
   */
  public LogEntry(Level level, long timestamp, String message) {
    this.level = level;
    this.timestamp = timestamp;
    this.message = message;
  }

  public Level getLevel() {
    return level;
  }

  public long getTimestamp() {
    return timestamp;
  }

  public String getMessage() {
    return message;
  }

  @Override
  public String toString() {
    return String.format("%d %s %s", timestamp, level, message);
  }

  public JSONObject toJson() {
    return new JSONObject(ImmutableMap.of(
      "timestamp", timestamp,
      "message", message,
      "level", level.getName()));
  }
}
@@ -14,17 +14,17 @@
 2007-201
-1
+2
  Seleniu
@@ -35,16 +35,60 @@
 mmitters
+%0ACopyright 2012 Software Freedom Conservancy
 %0A%0APortio
@@ -714,31 +714,46 @@
 ort 
-java.util.logging.Level
+com.google.common.collect.ImmutableMap
 ;%0A%0Ai
@@ -791,118 +791,270 @@
 ort 
-com.google.common.collect.ImmutableMap;%0A%0A/**%0A * Represents a single log statement.%0A */%0Apublic class LogEntry %7B
+java.sql.Date;%0Aimport java.text.SimpleDateFormat;%0Aimport java.util.logging.Level;%0A%0A/**%0A * Represents a single log statement.%0A */%0Apublic class LogEntry %7B%0A%0A  private static final SimpleDateFormat DATE_FORMAT =%0A      new SimpleDateFormat(%22yyyy-MM-dd'T'HH:mm:ssZ%22);%0A
 %0A  p
@@ -1172,17 +1172,24 @@
 vel 
+    
 the 
-level
+severity
  of 
@@ -1199,20 +1199,14 @@
  log
-,
  e
-.g. INFO.
+ntry
 %0A   
@@ -1228,25 +1228,18 @@
 amp 
-long value of the
+UNIX Epoch
  tim
@@ -1272,17 +1272,8 @@
 ntry
-%0A   *    
  was
@@ -1280,17 +1280,16 @@
  created
-.
 %0A   * @p
@@ -1305,22 +1305,19 @@
 age 
-String
+ew 
  the log
 's m
@@ -1312,16 +1312,22 @@
  the log
+ entry
 's messa
@@ -1328,17 +1328,16 @@
  message
-.
 %0A   */%0A 
@@ -1495,114 +1495,421 @@
 %0A%0A  
-public Level getLevel() %7B%0A    return level;%0A  %7D%0A%0A  public long getTimestamp() %7B%0A    return timestamp;%0A  %7D%0A
+/**%0A   * Gets the logging entry's severity.%0A   *%0A   * @return severity of log statement%0A   */%0A  public Level getLevel() %7B%0A    return level;%0A  %7D%0A%0A  /**%0A   * Gets the timestamp of the log statement in seconds since UNIX Epoch.%0A   *%0A   * @return timestamp as UNIX Epoch%0A   */%0A  public long getTimestamp() %7B%0A    return timestamp;%0A  %7D%0A%0A  /**%0A   * Gets the log entry's message.%0A   *%0A   * @return the log statement%0A   */
 %0A  p
@@ -2032,51 +2032,148 @@
 at(%22
-%25d 
+%5B%25s%5D %5B
 %25s
+%5D
  %25s%22,
- timestamp, level, message);%0A  %7D%0A
+%0A                         DATE_FORMAT.format(new Date(timestamp * 1000L)), level, message);%0A  %7D%0A%0A  @SuppressWarnings(%22unused%22)
 %0A  p
@@ -2243,16 +2243,18 @@
 Map.of(%0A
+  
       %22t
@@ -2281,16 +2281,18 @@
 ,%0A      
+  
 %22message
@@ -2303,16 +2303,18 @@
 essage,%0A
+  
       %22l
@@ -2343,9 +2343,10 @@
 ));%0A  %7D%0A
+%0A
 %7D

Add date formatting for LogEntry#toString(), otherwise no functional changes