Revision created by MOE tool push_codebase.
[gae.git] / java / src / main / com / google / appengine / api / log / AppLogLine.java
blob31fbcd5ebe3330f4890a92176bebc1aba2b46865
1 // Copyright 2011 Google Inc. All Rights Reserved.
3 package com.google.appengine.api.log;
5 import com.google.appengine.api.log.LogService.LogLevel;
7 /**
8 * An AppLogLine contains all the information for a single application
9 * log. Specifically, this information is: (1) the time at which the logged
10 * event occurred, (2) the level that the event was logged at, and (3) the
11 * message associated with this event. AppLogLines may be inserted by the user
12 * via logging frameworks, or by App Engine itself if we wish to alert the user
13 * that certain events have occurred.
17 public final class AppLogLine {
18 private long timeUsec;
19 private LogLevel logLevel;
20 private String logMessage;
22 /**
23 * Default zero-argument constructor that creates an AppLogLine.
25 public AppLogLine() {
29 /**
30 * Constructs a new application log.
32 * @param newTimeUsec The time that the logged event has occurred at, in
33 * microseconds since epoch.
34 * @param newLogLevel The level that the event was logged at.
35 * @param newLogMessage The message associated with this event.
37 AppLogLine(long newTimeUsec, LogLevel newLogLevel, String newLogMessage) {
38 timeUsec = newTimeUsec;
39 logLevel = newLogLevel;
40 logMessage = newLogMessage;
43 public LogLevel getLogLevel() {
44 return logLevel;
47 public String getLogMessage() {
48 return logMessage;
51 public long getTimeUsec() {
52 return timeUsec;
55 public void setLogLevel(LogLevel logLevel) {
56 this.logLevel = logLevel;
59 public void setLogMessage(String logMessage) {
60 this.logMessage = logMessage;
63 public void setTimeUsec(long timeUsec) {
64 this.timeUsec = timeUsec;
67 @Override
68 public String toString() {
69 return "AppLogLine{" +
70 "timeUsec=" + timeUsec +
71 ", logLevel=" + logLevel +
72 ", logMessage='" + logMessage + '\'' +
73 '}';