Class AbstractSimpleOutput
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.sink.simplelogging.output.AbstractSimpleOutput
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,SizeOfHandler,FlowContextHandler,SimpleOutput,Serializable
- Direct Known Subclasses:
ConsoleOutput,FileOutput,MultiOutput
public abstract class AbstractSimpleOutput extends AbstractOptionHandler implements SimpleOutput
Ancestor for output schemes.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Actorm_FlowContextthe flow context.-
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 AbstractSimpleOutput()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Stringcheck(String msg)Hook method for checks before attempting to log the message.protected abstract StringdoLogMessage(String msg)Logs the (formatted) logging message.ActorgetFlowContext()Returns the flow context.StringgetQuickInfo()Returns a quick info about the object, which can be displayed in the GUI.StringlogMessage(String msg)Logs the (formatted) logging message.booleanrequiresFlowContext()Returns whether flow context is really required.voidsetFlowContext(Actor value)Sets the flow context.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, 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
-
m_FlowContext
protected transient Actor m_FlowContext
the flow context.
-
-
Method Detail
-
setFlowContext
public void setFlowContext(Actor value)
Sets the flow context.- Specified by:
setFlowContextin interfaceFlowContextHandler- Parameters:
value- the context
-
getFlowContext
public Actor getFlowContext()
Returns the flow context.- Specified by:
getFlowContextin interfaceFlowContextHandler- Returns:
- the context, null if not available
-
requiresFlowContext
public boolean requiresFlowContext()
Returns whether flow context is really required.- Specified by:
requiresFlowContextin interfaceSimpleOutput- Returns:
- true if required
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.
Default implementation returns null.- Specified by:
getQuickInfoin interfaceQuickInfoSupporter- Returns:
- null if no info available, otherwise short string
-
check
protected String check(String msg)
Hook method for checks before attempting to log the message.
Default implementation accepts everything and only ensures that flow context is set if required.- Parameters:
msg- the message to log- Returns:
- null if checks passed, otherwise error message
-
doLogMessage
protected abstract String doLogMessage(String msg)
Logs the (formatted) logging message.- Parameters:
msg- the message to log- Returns:
- null if successful, otherwise error message
-
logMessage
public String logMessage(String msg)
Logs the (formatted) logging message.- Specified by:
logMessagein interfaceSimpleOutput- Parameters:
msg- the message to log- Returns:
- null if successful, otherwise error message
-
-