public abstract class AbstractLogFormatter extends Object implements LogFormatter
Modifier and Type | Field and Description |
---|---|
private static String |
DEFAULT_KEY
The default key to use for logging messages
|
protected String |
mProgram
The name of the program.
|
protected Stack<Event> |
mStack
The Stack of event objects maintained internally
|
Constructor and Description |
---|
AbstractLogFormatter()
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
LogFormatter |
add(String value)
Add to the log message with just a value.
|
LogFormatter |
add(String key,
String value)
Add to the log message for the event on the top.
|
abstract void |
addEvent(String name,
String entityName,
String entityID)
Adds the event that is to be associated with the log messages onto an
internal stack
|
String |
createEntityHierarchyMessage(String parentType,
String parentID,
String childIdType,
Collection<String> childIDs)
Creates a log message that connects the parent entities with the
children.
|
String |
createLogMessage()
Creates a log message with the contents of the internal log buffer.
|
String |
createLogMessageAndReset()
Creates a log message with the contents of the internal log buffer.
|
String |
getEndEventMessage()
Creates the end message for the event on top of the stack.
|
String |
getEventName()
Returns the name of event that is currently associated with the log messages
and is on the top of the stack
|
String |
getProgramName(String name)
Returns the program name for the software whose log statement are logged.
|
String |
getStartEventMessage()
Creates the start message for the event on top of the internal stack
|
Event |
popEvent()
Pop the event on top of the internal stack.
|
void |
setProgramName(String name)
Sets the program name for the software whose log statement are logged.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addEvent
private static String DEFAULT_KEY
protected String mProgram
public void setProgramName(String name)
setProgramName
in interface LogFormatter
name
- public String getProgramName(String name)
getProgramName
in interface LogFormatter
name
- public abstract void addEvent(String name, String entityName, String entityID)
addEvent
in interface LogFormatter
name
- the name of the event to be associatedentityName
- the primary entity that is associated with the event e.g. workflowentityID
- the id of that entity.public Event popEvent()
popEvent
in interface LogFormatter
public String getEventName()
getEventName
in interface LogFormatter
public String getStartEventMessage()
getStartEventMessage
in interface LogFormatter
public String getEndEventMessage()
getEndEventMessage
in interface LogFormatter
public LogFormatter add(String value)
add
in interface LogFormatter
value
- public LogFormatter add(String key, String value)
add
in interface LogFormatter
key
- value
- public String createLogMessage()
createLogMessage
in interface LogFormatter
public String createLogMessageAndReset()
createLogMessageAndReset
in interface LogFormatter
public String createEntityHierarchyMessage(String parentType, String parentID, String childIdType, Collection<String> childIDs)
createEntityHierarchyMessage
in interface LogFormatter
parentType
- the type of parent entityparentID
- the id of the parent entitychildIdType
- the type of children entitieschildIDs
- Collection of children id'sCopyright © 2011 The University of Southern California. All Rights Reserved.