Package adams.core.command.stdout
Class Log
-
- All Implemented Interfaces:
CleanUpHandler
,StdOutProcessor
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,Serializable
public class Log extends AbstractStdOutProcessor
Outputs the data received from the command's stdout via its logger instance.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
m_LoggingPrefix
the logging prefix.protected String
m_LoggingPrefixFormat
the logging prefix to use.static String
PH_FULLNAME
static String
PH_NAME
-
Fields inherited from class adams.core.command.stdout.AbstractStdOutProcessor
m_Owner
-
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 Log()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configureLogger()
Initializes the logger.void
defineOptions()
Adds options to the internal list of options.protected LoggingLevel
getDefaultLoggingLevel()
Returns the default logging level to use.String
getLoggingPrefixFormat()
Returns the format for the logging prefix.String
globalInfo()
Returns a string describing the object.String
loggingPrefixFormatTipText()
Returns the tip text for this property.void
processAsync(String output)
Processes the stdout output received when in async mode.void
processBlocking(String output)
Processes the stdout output received when in blocking mode.void
setLoggingPrefixFormat(String value)
Sets the format for the logging prefix.String
setUp(FlowContextHandler owner)
Configures the handler.-
Methods inherited from class adams.core.command.stdout.AbstractStdOutProcessor
cleanUp
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
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.Destroyable
destroy
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
Field Detail
-
PH_FULLNAME
public static final String PH_FULLNAME
- See Also:
- Constant Field Values
-
PH_NAME
public static final String PH_NAME
- See Also:
- Constant Field Values
-
m_LoggingPrefixFormat
protected String m_LoggingPrefixFormat
the logging prefix to use.
-
m_LoggingPrefix
protected String m_LoggingPrefix
the logging prefix.
-
-
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
-
getDefaultLoggingLevel
protected LoggingLevel getDefaultLoggingLevel()
Returns the default logging level to use.- Overrides:
getDefaultLoggingLevel
in classAbstractOptionHandler
- Returns:
- the logging level
-
configureLogger
protected void configureLogger()
Initializes the logger.- Overrides:
configureLogger
in classLoggingObject
-
setLoggingPrefixFormat
public void setLoggingPrefixFormat(String value)
Sets the format for the logging prefix.- Parameters:
value
- the format
-
getLoggingPrefixFormat
public String getLoggingPrefixFormat()
Returns the format for the logging prefix.- Returns:
- the name
-
loggingPrefixFormatTipText
public String loggingPrefixFormatTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setUp
public String setUp(FlowContextHandler owner)
Configures the handler.- Specified by:
setUp
in interfaceStdOutProcessor
- Overrides:
setUp
in classAbstractStdOutProcessor
- Parameters:
owner
- the owning command- Returns:
- null if successfully setup, otherwise error message
-
processAsync
public void processAsync(String output)
Processes the stdout output received when in async mode.- Specified by:
processAsync
in interfaceStdOutProcessor
- Specified by:
processAsync
in classAbstractStdOutProcessor
- Parameters:
output
- the output to process
-
processBlocking
public void processBlocking(String output)
Processes the stdout output received when in blocking mode.- Specified by:
processBlocking
in interfaceStdOutProcessor
- Specified by:
processBlocking
in classAbstractStdOutProcessor
- Parameters:
output
- the output to process
-
-