Class TimestampedFormat
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.sink.simplelogging.format.AbstractSimpleFormat
-
- adams.flow.sink.simplelogging.format.TimestampedFormat
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,SizeOfHandler,FlowContextHandler,SimpleFormat,Serializable
public class TimestampedFormat extends AbstractSimpleFormat
Outputs the message using the specified format.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringm_LogFormatthe format string.protected Stringm_MessageIndentationthe indentation to use for the message.protected DateFormatStringm_TimestampFormatthe timestamp format.protected DateFormatm_TimestampFormatterthe date formatter in use.static StringPLACEHOLDER_MESSAGEthe placeholder for the message.static StringPLACEHOLDER_TIMESTAMPthe placeholder for the timestamp.-
Fields inherited from class adams.flow.sink.simplelogging.format.AbstractSimpleFormat
m_FlowContext
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description TimestampedFormat()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.protected StringdoFormatMessage(String msg)Formats the logging message and returns the updated message.StringgetLogFormat()Returns the format for the message.StringgetMessageIndentation()Returns the indentation string to prefix each line of the message with.StringgetQuickInfo()Returns a quick info about the object, which can be displayed in the GUI.DateFormatStringgetTimestampFormat()Returns the format for the timestamp.StringglobalInfo()Returns a string describing the object.StringlogFormatTipText()Returns the tip text for this property.StringmessageIndentationTipText()Returns the tip text for this property.protected voidreset()Resets the scheme.voidsetLogFormat(String value)Sets the format for the message.voidsetMessageIndentation(String value)Sets the indentation string to prefix each line of the message with.voidsetTimestampFormat(DateFormatString value)Sets the format for the timestamp.StringtimestampFormatTipText()Returns the tip text for this property.-
Methods inherited from class adams.flow.sink.simplelogging.format.AbstractSimpleFormat
check, formatMessage, getFlowContext, requiresFlowContext, setFlowContext
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
PLACEHOLDER_TIMESTAMP
public static final String PLACEHOLDER_TIMESTAMP
the placeholder for the timestamp.- See Also:
- Constant Field Values
-
PLACEHOLDER_MESSAGE
public static final String PLACEHOLDER_MESSAGE
the placeholder for the message.- See Also:
- Constant Field Values
-
m_TimestampFormat
protected DateFormatString m_TimestampFormat
the timestamp format.
-
m_TimestampFormatter
protected transient DateFormat m_TimestampFormatter
the date formatter in use.
-
m_MessageIndentation
protected String m_MessageIndentation
the indentation to use for the message.
-
m_LogFormat
protected String m_LogFormat
the format string.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
reset
protected void reset()
Resets the scheme.- Overrides:
resetin classAbstractOptionHandler
-
setTimestampFormat
public void setTimestampFormat(DateFormatString value)
Sets the format for the timestamp.- Parameters:
value- the format
-
getTimestampFormat
public DateFormatString getTimestampFormat()
Returns the format for the timestamp.- Returns:
- the format
-
timestampFormatTipText
public String timestampFormatTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setMessageIndentation
public void setMessageIndentation(String value)
Sets the indentation string to prefix each line of the message with.- Parameters:
value- the indentation string
-
getMessageIndentation
public String getMessageIndentation()
Returns the indentation string to prefix each line of the message with.- Returns:
- the indentation string
-
messageIndentationTipText
public String messageIndentationTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setLogFormat
public void setLogFormat(String value)
Sets the format for the message.- Parameters:
value- the format
-
getLogFormat
public String getLogFormat()
Returns the format for the message.- Returns:
- the format
-
logFormatTipText
public String logFormatTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.- Specified by:
getQuickInfoin interfaceQuickInfoSupporter- Overrides:
getQuickInfoin classAbstractSimpleFormat- Returns:
- null if no info available, otherwise short string
-
doFormatMessage
protected String doFormatMessage(String msg)
Formats the logging message and returns the updated message.- Specified by:
doFormatMessagein classAbstractSimpleFormat- Parameters:
msg- the message to format- Returns:
- the formatted message
-
-