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 Stringm_LoggingPrefixthe logging prefix.protected Stringm_LoggingPrefixFormatthe logging prefix to use.static StringPH_FULLNAMEstatic StringPH_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 voidconfigureLogger()Initializes the logger.voiddefineOptions()Adds options to the internal list of options.protected LoggingLevelgetDefaultLoggingLevel()Returns the default logging level to use.StringgetLoggingPrefixFormat()Returns the format for the logging prefix.StringglobalInfo()Returns a string describing the object.StringloggingPrefixFormatTipText()Returns the tip text for this property.voidprocessAsync(String output)Processes the stdout output received when in async mode.voidprocessBlocking(String output)Processes the stdout output received when in blocking mode.voidsetLoggingPrefixFormat(String value)Sets the format for the logging prefix.StringsetUp(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:
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
-
getDefaultLoggingLevel
protected LoggingLevel getDefaultLoggingLevel()
Returns the default logging level to use.- Overrides:
getDefaultLoggingLevelin classAbstractOptionHandler- Returns:
- the logging level
-
configureLogger
protected void configureLogger()
Initializes the logger.- Overrides:
configureLoggerin 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:
setUpin interfaceStdOutProcessor- Overrides:
setUpin 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:
processAsyncin interfaceStdOutProcessor- Specified by:
processAsyncin classAbstractStdOutProcessor- Parameters:
output- the output to process
-
processBlocking
public void processBlocking(String output)
Processes the stdout output received when in blocking mode.- Specified by:
processBlockingin interfaceStdOutProcessor- Specified by:
processBlockingin classAbstractStdOutProcessor- Parameters:
output- the output to process
-
-