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 String
m_LogFormat
the format string.protected String
m_MessageIndentation
the indentation to use for the message.protected DateFormatString
m_TimestampFormat
the timestamp format.protected DateFormat
m_TimestampFormatter
the date formatter in use.static String
PLACEHOLDER_MESSAGE
the placeholder for the message.static String
PLACEHOLDER_TIMESTAMP
the 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 void
defineOptions()
Adds options to the internal list of options.protected String
doFormatMessage(String msg)
Formats the logging message and returns the updated message.String
getLogFormat()
Returns the format for the message.String
getMessageIndentation()
Returns the indentation string to prefix each line of the message with.String
getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.DateFormatString
getTimestampFormat()
Returns the format for the timestamp.String
globalInfo()
Returns a string describing the object.String
logFormatTipText()
Returns the tip text for this property.String
messageIndentationTipText()
Returns the tip text for this property.protected void
reset()
Resets the scheme.void
setLogFormat(String value)
Sets the format for the message.void
setMessageIndentation(String value)
Sets the indentation string to prefix each line of the message with.void
setTimestampFormat(DateFormatString value)
Sets the format for the timestamp.String
timestampFormatTipText()
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:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
reset
protected void reset()
Resets the scheme.- Overrides:
reset
in 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:
getQuickInfo
in interfaceQuickInfoSupporter
- Overrides:
getQuickInfo
in 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:
doFormatMessage
in classAbstractSimpleFormat
- Parameters:
msg
- the message to format- Returns:
- the formatted message
-
-