'N/A' for null user in EventLogRecord.toString
This commit is contained in:
parent
32512cde90
commit
e86a150a8d
|
@ -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.
|
||||||
*/
|
*/
|
||||||
|
@ -184,7 +193,7 @@ public class EventLogRecord {
|
||||||
"[" + getSource() + "] " +
|
"[" + getSource() + "] " +
|
||||||
"[" + getCategoryString() + "] " +
|
"[" + getCategoryString() + "] " +
|
||||||
"[" + getEventId() + "] " +
|
"[" + getEventId() + "] " +
|
||||||
"[" + getUser() + "] " +
|
"[" + getUserString() + "] " +
|
||||||
"[" + getComputerName() + "] " +
|
"[" + getComputerName() + "] " +
|
||||||
getMessage();
|
getMessage();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue