Merge branch 'sigar-1.6'

This commit is contained in:
Doug MacEachern 2009-11-09 16:47:54 -08:00
commit 818de4a64c
1 changed files with 14 additions and 2 deletions

View File

@ -25,6 +25,8 @@ import java.util.Date;
*/ */
public class EventLogRecord { public class EventLogRecord {
private static final String NA = "N/A";
long recordNumber; long recordNumber;
long timeGenerated; long timeGenerated;
long timeWritten; long timeWritten;
@ -158,7 +160,14 @@ public class EventLogRecord {
public String getUser() { public String getUser() {
return this.user; return this.user;
} }
private String getUserString() {
if (this.user == null) {
return NA;
}
return this.user;
}
/** /**
* Get the message for the event. * Get the message for the event.
*/ */
@ -179,10 +188,13 @@ public class EventLogRecord {
public String toString() public String toString()
{ {
return return
"[" + new Date(getTimeGenerated() * 1000) + "] " +
"[" + getEventTypeString() + "] " + "[" + getEventTypeString() + "] " +
"[" + new Date(getTimeGenerated() * 1000) + "] " +
"[" + getSource() + "] " + "[" + getSource() + "] " +
"[" + getCategoryString() + "] " + "[" + getCategoryString() + "] " +
"[" + (getEventId() & 0xFFFF) + "] " +
"[" + getUserString() + "] " +
"[" + getComputerName() + "] " +
getMessage(); getMessage();
} }
} }