com.sap.tc.logging
Class LogController

java.lang.Object
  |
  +--com.sap.tc.logging.ExceptionHandling
        |
        +--com.sap.tc.logging.LogController
All Implemented Interfaces:
IObjectInfo
Direct Known Subclasses:
Category, Location

public abstract class LogController
extends ExceptionHandling
implements IObjectInfo

Controls output to logs, which stand for destinations to write log messages to. Log controllers are the objects you call to write messages. To this end, log controllers provide you with methods for associating logs with them and for controlling the actual writing of messages. In practive, however, you deal with concrete subclasses of this abstract class, such as Location for trace messages or Category for log messages. As the signatures of the methods to emit messages depend on these concrete classes, we have furnished them rather than log controllers with these methods, so there are no abstract output methods.

When you call an output method, the actual writing of the message to a log depends on the severities of the message at hand, the log controller and the logs attached to it, as well as optional filters associated with the latter two. Typical severities are error and warning, and you can find constants for all the possible severities in the class Severity. Messages which have at least the effective severity of the controller are candidates for output and are forwarded to the logs attached to the controller with the method addLog(Log). Beforehand, however, filters get the chance to veto the decision on basis of the internal message representation, the LogRecord.

Log controllers are automatically ordered into hierarchies. Hierarchies of controllers are built up according to the hierarchical naming schemes of the concrete subclasses of LogController. A child log controller inherits some properties from its parent, for example its severity and its logs. The effective severity of a child log controller is calculated from its minimum and maximum severities, as well as the effective severity of its parent. Most of the time you will have no need for these two severities. Instead you will either use the setting inherited from the parent controller or override the parent setting with an explicit effective value for the child. To do the latter, call the method setEffectiveSeverity(int) with the effective value you would like to have logged.

Time and again, however, you will want to use a more elaborate scheme to control severities, and have different minimum and maximum severities set with calls to setMinimumSeverity(int) and setMaximumSeverity(int), respectively. With the minimum severity you specify the severity that messages must have at the least to be output via the child log controller. That is, if the effective severity of the parent log controller is higher than the minimum severity of the child than the latter inherits the parent's effective severity, otherwise it is set to the minimum severity. On the other hand, you specify the severity that messages must have for output to be guaranteed, save intervention from filters, using the maximum severity. That is, if the effective severity of the parent log controller is lower than the maximum severity of the child than the latter inherits the parent's effective severity, otherwise it is set to the maximum severity. This implies that if both minimum and maximum severity are set to the same value the effective severity gets that value regardless of the effective severity of the parent. Such a setting is therefore called dominant. For root log controllers the setting must be dominant, as separate minimum and maximum values are meaningless without a parent to inherit from.

Please find fundamental information about the principles of error handling in the package description. In the case of this class, if a value is out of range for one of the calls dealing with severities, the methods ExceptionHandling.getException() and ExceptionHandling.throwException() are served with a java.lang.IllegalArgumentException.

See Also:
Log, LogRecord, Severity, Filter

Method Summary
 void addFilter(Filter filter)
          Adds another filter that, besides the effective severity, controls output via this log controller.
 void addLocalLog(Log log)
          Adds another local log for this log controller to write messages to.
 void addLog(Log log)
          Adds another log for this log controller to write messages to.
 void addPrivateLog(Log log)
          Adds another private log for this log controller to write messages to.
 boolean beDebug()
          Same as beLogged(int) but always checks for a debug message, that is a message with severity Severity.DEBUG.
 boolean beDebug(LogController relative)
          Same as beLogged(int, LogController) but always checks for a debug message, that is a message with severity Severity.DEBUG.
 boolean beDebug(LogController[] relatives)
          Same as beLogged(int, LogController[]) but always checks for a debug message, that is a message with severity Severity.DEBUG.
 boolean beError()
          Same as beLogged(int) but always checks for an error message, that is a message with severity Severity.ERROR.
 boolean beError(LogController relative)
          Same as beLogged(int, LogController) but always checks for an error message, that is a message with severity Severity.ERROR.
 boolean beError(LogController[] relatives)
          Same as beLogged(int, LogController[]) but always checks for an error message, that is a message with severity Severity.ERROR.
 boolean beFatal()
          Same as beLogged(int) but always checks for a fatal error message, that is a message with severity Severity.FATAL.
 boolean beFatal(LogController relative)
          Same as beLogged(int, LogController) but always checks for a fatal error message, that is a message with severity Severity.FATAL.
 boolean beFatal(LogController[] relatives)
          Same as beLogged(int, LogController[]) but always checks for a fatal error message, that is a message with severity Severity.FATAL.
 boolean beGroup()
          Checks whether a message with group severity would be written via this log controller.
 boolean beInfo()
          Same as beLogged(int) but always checks for an informational message, that is a message with severity Severity.INFO.
 boolean beInfo(LogController relative)
          Same as beLogged(int, LogController) but always checks for an informational message, that is a message with severity Severity.INFO.
 boolean beInfo(LogController[] relatives)
          Same as beLogged(int, LogController[]) but always checks for an informational message, that is a message with severity Severity.INFO.
 boolean beLogged(int severity)
          Checks whether a message with the specified severity would be written via this log controller.
 boolean beLogged(int severity, LogController relative)
          Checks whether a message with the specified severity would be written via this log controller with respect to another log controller.
 boolean beLogged(int severity, LogController[] relatives)
          Same as beLogged(int, LogController) but returns true if one of the specified log controllers yields a positive result.
 boolean bePath()
          Same as beLogged(int) but always checks for a path message, that is a message with severity Severity.PATH.
 boolean bePath(LogController relative)
          Same as beLogged(int, LogController) but always checks for a path message, that is a message with severity Severity.PATH.
 boolean bePath(LogController[] relatives)
          Same as beLogged(int, LogController[]) but always checks for a path message, that is a message with severity Severity.PATH.
 boolean beWarning()
          Same as beLogged(int) but always checks for a warning message, that is a message with severity Severity.WARNING.
 boolean beWarning(LogController relative)
          Same as beLogged(int, LogController) but always checks for a warning message, that is a message with severity Severity.WARNING.
 boolean beWarning(LogController[] relatives)
          Same as beLogged(int, LogController[]) but always checks for a warning message, that is a message with severity Severity.WARNING.
 void closeGroup()
          Closes the innermost message group of this controller.
 java.util.Collection getAllLogs()
          Gets all logs (public, private, local and logs inherent from parent) this log controller writes messages to.
 java.util.Collection getChildren()
          Gets the collection of children of this log controller.
 java.lang.ClassLoader getClassLoader()
          Gets the class loader assigned to this log controller for getting resource bundles.
 java.lang.String getDescription()
          Gets the description for this log.
 int getEffectiveSeverity()
          Gets the current effective severity of this log controller.
 int getEffectiveSeverity(LogController relative)
          Gets the current effective severity of this log controller with respect to another log controller.
 int getEffectiveSeverity(LogController[] relatives)
          Same as getEffectiveSeverity(LogController) but returns the minimum of the values of the specified log controllers.
 java.util.Collection getFilters()
          Gets the filters that, besides the effective severity, control output via this log controller.
 int getGroupSize()
          Return max open group size.
 java.util.Collection getLocalLogs()
          Gets the local logs this log controller writes messages to.
 int getLoggedCnt()
           
 int getLoggedCount()
           
 java.util.Collection getLogs()
          Gets the normal logs this log controller writes messages to.
 int getMaximumSeverity()
          Gets the current maximum severity of this log controller.
 int getMaximumSeverity(LogController relative)
          Gets the current maximum severity of this log controller with respect to another log controller.
 int getMaximumSeverity(LogController[] relatives)
          Same as getMaximumSeverity(LogController) but returns the minimum of the values of the specified log controllers.
 int getMinimumSeverity()
          Gets the current minimum severity of this log controller.
 int getMinimumSeverity(LogController relative)
          Gets the current minimum severity of this log controller with respect to another log controller.
 int getMinimumSeverity(LogController[] relatives)
          Same as getMinimumSeverity(LogController) but returns the minimum of the values of the specified log controllers.
 java.lang.String getName()
          Gets the name for this log.
 java.util.Collection getPrivateLogs()
          Gets the private logs this log controller writes messages to.
 LogRecord getRecord()
          Gets the last log record written via this log controller.
 LogController[] getRelatives()
           
 java.lang.String getResourceBundleName()
          Gets the name of the optional resource bundle assigned to this log controller.
 java.lang.String getVerInUse()
          Gets the version of API.
 LogRecord group(java.lang.Object msgCode)
          Logs group message, specified as a resource name, from this controller.
 LogRecord group(java.lang.Object msgCode, java.lang.Object[] args)
          Logs message, specified as resource name, with parameters from this controller.
 LogRecord group(java.lang.Object msgCode, java.lang.Object[] args, java.lang.String msgClear)
          Logs message, specified as resource name, with parameters from this controller.
 LogRecord group(java.lang.Object msgCode, java.lang.String msgClear)
          Logs group message, specified as a resource name, from this controller.
 LogRecord group(java.lang.String subloc, java.lang.Object msgCode)
          Same as group(java.lang.Object) but appends a string denoting a sublocation to the name of the group location.
 LogRecord group(java.lang.String subloc, java.lang.Object msgCode, java.lang.Object[] args)
          Same as group(java.lang.Object, java.lang.Object[]) but appends a string denoting a sublocation to the name of the group location.
 LogRecord group(java.lang.String subloc, java.lang.Object msgCode, java.lang.Object[] args, java.lang.String msgClear)
          Same as group(java.lang.Object, java.lang.Object[], java.lang.String) but appends a string denoting a sublocation to the name of the group location.
 LogRecord group(java.lang.String subloc, java.lang.Object msgCode, java.lang.String msgClear)
          Same as group(java.lang.Object, java.lang.String) but appends a string denoting a sublocation to the name of the group location.
 LogRecord groupT(java.lang.String msg)
          Logs simple group message from this controller.
 LogRecord groupT(java.lang.String msg, java.lang.Object[] args)
          Logs group message with parameters from this controller.
 LogRecord groupT(java.lang.String subloc, java.lang.String msg)
          Same as groupT(java.lang.String) but appends a string denoting a sublocation to the name of the group location.
 LogRecord groupT(java.lang.String subloc, java.lang.String msg, java.lang.Object[] args)
          Same as groupT(java.lang.String, java.lang.Object[]) but appends a string denoting a sublocation to the name of the group location.
 boolean isActivityTracking()
           
 boolean isFiltersAgreeing(LogRecord rec)
          Checks whether all filters associated with this log controller agree with writing a log record.
 void release()
          Drops all internal references to this log controller and its children.
 void removeFilter(Filter filter)
          Removes a filter, so that it no longer controls output via this log controller.
 void removeFilters()
          Removes all filters associated with this log controller.
 void removeLog(Log log)
          Removes a log associated with this log controller.
 void removeLogs()
          Removes all logs associated with this log controller.
 void reset()
          Reset this LogController to the initail state.
 void resetAll()
          Reset this LogController and his children to the initail state
 void resetLoggedCount()
           
static void setActivityTracking(ISATChecker value)
           
 void setClassLoader()
          Resets the class loader assigned to this log controller for getting resource bundles.
 void setClassLoader(java.lang.ClassLoader classLoader)
          Assigns a class loader to this log controller for getting resource bundles.
 void setDescription(java.lang.String value)
          Sets a description for this log.
 void setEffectiveSeverity()
          Resets the effective severity of this log controller.
 void setEffectiveSeverity(int severity)
          Sets the effective severity of this log controller.
 void setGroupSize(int size)
          Set the max group size which indicate how many nested group can be opened on this LogController.
 void setMaximumSeverity()
          Resets the maximum severity of this log controller.
 void setMaximumSeverity(int severity)
          Sets the maximum severity of this log controller.
 void setMinimumSeverity()
          Resets the minimum severity of this log controller.
 void setMinimumSeverity(int severity)
          Sets the minimum severity of this log controller.
 void setName(java.lang.String name)
          Sets a name for this log.
 void setResourceBundleName()
          Resets the resource bundle name of this log controller.
 void setResourceBundleName(java.lang.String resourceBundleName)
          Assigns a resource bundle name to this log controller.
 
Methods inherited from class com.sap.tc.logging.ExceptionHandling
getException, getExceptions, handleException, handleException, resetException, throwException
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

release

public void release()
Drops all internal references to this log controller and its children. Thus, these log controllers become eligible for garbage collection when all external references have been eliminated. You should call this method on temporary controllers as soon as you are finished using them. Note, however, that after calling this method, requesting a log controller with the same name yields a different instance. In effect, all configuration data stored in this controller, for example severities, are lost. Also note that the same holds true for relative severities regarding this controller.

reset

public void reset()
Reset this LogController to the initail state.

resetAll

public void resetAll()
Reset this LogController and his children to the initail state

getName

public java.lang.String getName()
Gets the name for this log. Can be null.
Specified by:
getName in interface IObjectInfo

setName

public void setName(java.lang.String name)
Sets a name for this log. An optional courtesy feature for user to easily refer to a log. Highly recommended if logviewer tool will be used to browse the output messages. If no name is specified, nothing will be set and the value is null.

getDescription

public java.lang.String getDescription()
Gets the description for this log. Can be null.
Specified by:
getDescription in interface IObjectInfo

setDescription

public void setDescription(java.lang.String value)
Sets a description for this log. An optional courtesy feature for user to easily refer to a log. Highly recommended if logviewer tool will be used to browse the output messages. If no name is specified, nothing will be set and the value is null.

getVerInUse

public java.lang.String getVerInUse()
Gets the version of API.
Specified by:
getVerInUse in interface IObjectInfo

getChildren

public java.util.Collection getChildren()
Gets the collection of children of this log controller.
Returns:
Unmodifiable collection of children

closeGroup

public void closeGroup()
Closes the innermost message group of this controller. After a call to this method a group message should be emitted, which becomes the closing message of the group. This method leaves an exception if there was no message group open on this controller.
See Also:
Location.openGroup(...), Category.openGroup(...), ExceptionHandling.getException(), ExceptionHandling.throwException()

getGroupSize

public int getGroupSize()
Return max open group size.
See Also:
setGroupSize(int)

setGroupSize

public void setGroupSize(int size)
Set the max group size which indicate how many nested group can be opened on this LogController.

groupT

public LogRecord groupT(java.lang.String msg)
Logs simple group message from this controller.
Parameters:
msg - Message text
Returns:
Log record if written via a log of this log controller or null

groupT

public LogRecord groupT(java.lang.String subloc,
                        java.lang.String msg)
Same as groupT(java.lang.String) but appends a string denoting a sublocation to the name of the group location.
Parameters:
subloc - Name of sublocation
msg - Message text
Returns:
Log record if written via a log of this log controller or null

groupT

public LogRecord groupT(java.lang.String msg,
                        java.lang.Object[] args)
Logs group message with parameters from this controller. The objects handed over as arguments are written using the method toString.
Parameters:
msg - Message template
args - Arguments as object references
Returns:
Log record if written via a log of this log controller or null

groupT

public LogRecord groupT(java.lang.String subloc,
                        java.lang.String msg,
                        java.lang.Object[] args)
Same as groupT(java.lang.String, java.lang.Object[]) but appends a string denoting a sublocation to the name of the group location.
Parameters:
subloc - Name of sublocation
msg - Message text
args - Arguments as object references
Returns:
Log record if written via a log of this log controller or null

group

public LogRecord group(java.lang.Object msgCode)
Logs group message, specified as a resource name, from this controller. This method also stores a clear text version of the message, taken from the resource bundle for language code en and country code US, which is displayed whenever a log viewer cannot resolve a message code.
Parameters:
msgCode - Resource name of message
Returns:
Log record if written via a log of this log controller or null
See Also:
setResourceBundleName(java.lang.String)

group

public LogRecord group(java.lang.String subloc,
                       java.lang.Object msgCode)
Same as group(java.lang.Object) but appends a string denoting a sublocation to the name of the group location.
Parameters:
subloc - Name of sublocation
msgCode - Resource name of message
Returns:
Log record if written via a log of this log controller or null
See Also:
setResourceBundleName(java.lang.String)

group

public LogRecord group(java.lang.Object msgCode,
                       java.lang.Object[] args)
Logs message, specified as resource name, with parameters from this controller. The objects handed over as arguments are written using the method toString. This method also stores a clear text version of the message, taken from the resource bundle for language code en and country code US, which is displayed whenever a log viewer cannot resolve a message code.
Parameters:
msgCode - Resource name of message template
args - Arguments as object references
Returns:
Log record if written via a log of this log controller or null
See Also:
setResourceBundleName(java.lang.String)

group

public LogRecord group(java.lang.String subloc,
                       java.lang.Object msgCode,
                       java.lang.Object[] args)
Same as group(java.lang.Object, java.lang.Object[]) but appends a string denoting a sublocation to the name of the group location.
Parameters:
subloc - Name of sublocation
msgCode - Resource name of message
args - Arguments as object references
Returns:
Log record if written via a log of this log controller or null
See Also:
setResourceBundleName(java.lang.String)

group

public LogRecord group(java.lang.Object msgCode,
                       java.lang.String msgClear)
Logs group message, specified as a resource name, from this controller. This method also stores a clear text version of the message which is displayed whenever a log viewer cannot resolve a message code.
Parameters:
msgCode - Resource name of message
msgClear - Clear text version of message
Returns:
Log record if written via a log of this log controller or null
See Also:
setResourceBundleName(java.lang.String)

group

public LogRecord group(java.lang.String subloc,
                       java.lang.Object msgCode,
                       java.lang.String msgClear)
Same as group(java.lang.Object, java.lang.String) but appends a string denoting a sublocation to the name of the group location.
Parameters:
subloc - Name of sublocation
msgCode - Resource name of message
msgClear - Clear text version of message
Returns:
Log record if written via a log of this log controller or null
See Also:
setResourceBundleName(java.lang.String)

group

public LogRecord group(java.lang.Object msgCode,
                       java.lang.Object[] args,
                       java.lang.String msgClear)
Logs message, specified as resource name, with parameters from this controller. The objects handed over as arguments are written using the method toString. This method also stores a clear text version of the message which is displayed whenever a log viewer cannot resolve a message code.
Parameters:
msgCode - Resource name of message template
args - Arguments as object references
msgClear - Clear text version of message
Returns:
Log record if written via a log of this log controller or null
See Also:
setResourceBundleName(java.lang.String)

group

public LogRecord group(java.lang.String subloc,
                       java.lang.Object msgCode,
                       java.lang.Object[] args,
                       java.lang.String msgClear)
Same as group(java.lang.Object, java.lang.Object[], java.lang.String) but appends a string denoting a sublocation to the name of the group location.
Parameters:
subloc - Name of sublocation
msgCode - Resource name of message
args - Arguments as object references
msgClear - Clear text version of message
Returns:
Log record if written via a log of this log controller or null
See Also:
setResourceBundleName(java.lang.String)

getRecord

public LogRecord getRecord()
Gets the last log record written via this log controller. A log record is the internal form of a log message.
Returns:
Last log record

getMinimumSeverity

public int getMinimumSeverity()
Gets the current minimum severity of this log controller.
Returns:
Minimum severity if set or Severity.ALL.

getMinimumSeverity

public int getMinimumSeverity(LogController relative)
Gets the current minimum severity of this log controller with respect to another log controller.
Parameters:
relative - Related log controller
Returns:
Minimum severity if set or Severity.ALL.

getMinimumSeverity

public int getMinimumSeverity(LogController[] relatives)
Same as getMinimumSeverity(LogController) but returns the minimum of the values of the specified log controllers. This is the value that is effective for a message directed to all of them at the same time, for example a message belonging to several categories.
Parameters:
relatives - Related log controllers
Returns:
Minimum severity if set or Severity.ALL.

getEffectiveSeverity

public int getEffectiveSeverity()
Gets the current effective severity of this log controller.
Returns:
Effective severity if set or Severity.NONE.

getEffectiveSeverity

public int getEffectiveSeverity(LogController relative)
Gets the current effective severity of this log controller with respect to another log controller.
Parameters:
relative - Related log controller
Returns:
Effective severity if set or Severity.NONE.

getEffectiveSeverity

public int getEffectiveSeverity(LogController[] relatives)
Same as getEffectiveSeverity(LogController) but returns the minimum of the values of the specified log controllers. This is the value that is effective for a message directed to all of them at the same time, for example a message belonging to several categories.
Parameters:
relatives - Related log controllers
Returns:
Effective severity if set or Severity.NONE.

getMaximumSeverity

public int getMaximumSeverity()
Gets the current maximum severity of this log controller.
Returns:
Maximum severity if set or Severity.NONE.

getMaximumSeverity

public int getMaximumSeverity(LogController relative)
Gets the current maximum severity of this log controller with respect to another log controller.
Parameters:
relative - Related log controller
Returns:
Maximum severity if set or Severity.NONE.

getMaximumSeverity

public int getMaximumSeverity(LogController[] relatives)
Same as getMaximumSeverity(LogController) but returns the minimum of the values of the specified log controllers. This is the value that is effective for a message directed to all of them at the same time, for example a message belonging to several categories.
Parameters:
relatives - Related log controllers
Returns:
Maximum severity if set or Severity.NONE.

setMinimumSeverity

public void setMinimumSeverity(int severity)
Sets the minimum severity of this log controller. If its current maximum severity is lower than the argument, the former is set to the argument. If it is a root controller, this method has the same effect as a call to setEffectiveSeverity(int).
Parameters:
severity - New minimum severity

setMinimumSeverity

public void setMinimumSeverity()
Resets the minimum severity of this log controller. If it is a root controller this method has no effect, otherwise it has the same effect as a call to setMinimumSeverity(int) with Severity.ALL.

setEffectiveSeverity

public void setEffectiveSeverity(int severity)
Sets the effective severity of this log controller. If it is a root controller, this method sets the effective severity to its argument, otherwise it has the same effect as calls with its argument to both setMinimumSeverity(int) and setMaximumSeverity(int).
Parameters:
severity - New effective severity

setEffectiveSeverity

public void setEffectiveSeverity()
Resets the effective severity of this log controller. If it is a root controller this method has no effect, otherwise it has the same effect as two calls to setMinimumSeverity() and setMaximumSeverity().

setMaximumSeverity

public void setMaximumSeverity(int severity)
Sets the maximum severity of this log controller. If its current minimum severity is higher than the argument, the former is set to the argument. If it is a root controller, the method has the same effect as a call to setEffectiveSeverity(int).
Parameters:
severity - New maximum severity

setMaximumSeverity

public void setMaximumSeverity()
Resets the maximum severity of this log controller. If it is a root controller this method has no effect, otherwise it has the same effect as a call to setMinimumSeverity(int) with Severity.NONE.

getLogs

public java.util.Collection getLogs()
Gets the normal logs this log controller writes messages to.
Returns:
Unmodifiable collection of logs associated with this log controller

getLocalLogs

public java.util.Collection getLocalLogs()
Gets the local logs this log controller writes messages to.
Returns:
Unmodifiable collection of logs associated with this log controller

getPrivateLogs

public java.util.Collection getPrivateLogs()
Gets the private logs this log controller writes messages to.
Returns:
Unmodifiable collection of logs associated with this log controller

getAllLogs

public java.util.Collection getAllLogs()
Gets all logs (public, private, local and logs inherent from parent) this log controller writes messages to.
Returns:
Unmodifiable collection of logs associated with this log controller

addLog

public void addLog(Log log)
Adds another log for this log controller to write messages to.
Parameters:
log - New log object

addLocalLog

public void addLocalLog(Log log)
Adds another local log for this log controller to write messages to. For writing a message into a local log, the severities and filters set for this controller must agree, as opposed to the settings of a child controller the message was possibly forwarded from.
Parameters:
log - New log object

addPrivateLog

public void addPrivateLog(Log log)
Adds another private log for this log controller to write messages to. For writing a message into a private log, it must not have been forwarded from a child controller but originally addressed to this controller.
Parameters:
log - New log object

removeLog

public void removeLog(Log log)
Removes a log associated with this log controller. If the log was not associated with the controller nothing is done.
Parameters:
log - Log to be removed

removeLogs

public void removeLogs()
Removes all logs associated with this log controller.

isFiltersAgreeing

public boolean isFiltersAgreeing(LogRecord rec)
Checks whether all filters associated with this log controller agree with writing a log record.
Parameters:
rec - Log record to be checked
Returns:
No filter vetoes writing

getFilters

public java.util.Collection getFilters()
Gets the filters that, besides the effective severity, control output via this log controller.
Returns:
Unmodifiable collection of filters associated with this log

addFilter

public void addFilter(Filter filter)
Adds another filter that, besides the effective severity, controls output via this log controller. The results of all filters for a given message are logically anded to determine whether a message is to be written to the associated log objects.
Parameters:
filter - New filter

removeFilter

public void removeFilter(Filter filter)
Removes a filter, so that it no longer controls output via this log controller.
Parameters:
filter - Filter to be removed

removeFilters

public void removeFilters()
Removes all filters associated with this log controller.

getRelatives

public LogController[] getRelatives()

getResourceBundleName

public java.lang.String getResourceBundleName()
Gets the name of the optional resource bundle assigned to this log controller. If a resource bundle is assigned, language-independent log messages can be written.
Returns:
Name of optional resource bundle or null
See Also:
setResourceBundleName(java.lang.String)

setResourceBundleName

public void setResourceBundleName(java.lang.String resourceBundleName)
Assigns a resource bundle name to this log controller. If a resource bundle is assigned, language-independent log messages can be written.
Parameters:
resourceBundle - Name of resource bundle
See Also:
getResourceBundleName()

setResourceBundleName

public void setResourceBundleName()
Resets the resource bundle name of this log controller.
See Also:
getResourceBundleName()

getClassLoader

public java.lang.ClassLoader getClassLoader()
Gets the class loader assigned to this log controller for getting resource bundles. If you emit a language-independent message without giving an explicit clear text version, the assigned class loader will be used to get the resource bundle from which to retrieve it. If no class loader is assigned, the bundle will be determined using the loader of this class or, if not successful, the context class loader of this thread.
Returns:
Assigned class loader
See Also:
setClassLoader(java.lang.ClassLoader)

setClassLoader

public void setClassLoader(java.lang.ClassLoader classLoader)
Assigns a class loader to this log controller for getting resource bundles. If you emit a language-independent message without giving an explicit clear text version, the assigned class loader will be used to get the resource bundle from which to retrieve it.
Parameters:
classLoader - Class loader
See Also:
getClassLoader()

setClassLoader

public void setClassLoader()
Resets the class loader assigned to this log controller for getting resource bundles. If you emit a language-independent message without giving an explicit clear text version, the assigned class loader will be used to get the resource bundle from which to retrieve it.
See Also:
getClassLoader()

beLogged

public boolean beLogged(int severity)
Checks whether a message with the specified severity would be written via this log controller. The purpose of this method is to avoid evaluating the arguments of a logging call, which is expensive and would be superfluous if a message is not written because of its insufficient severity. The result returned is necessary but not sufficient for writing log messages, that is if the method returns false the message is not going to be written but not vice versa. To this end, the method checks whether the specified severity is equal to or higher than the effective severity of the controller. It does neither take into account severities assigned to relations with other log controllers nor filters associated with the log controller or logs. This version of the method is more efficient than the version also taking another log controller as argument, and therefore better fits the purpose to avoid inefficiencies.
Parameters:
severity - Severity of message to be written
See Also:
beLogged(int, LogController), beLogged(int, LogController[])

beLogged

public boolean beLogged(int severity,
                        LogController relative)
Checks whether a message with the specified severity would be written via this log controller with respect to another log controller. The purpose of this method is to avoid evaluating the arguments of a logging call, which is expensive and would be superfluous if a message is not written because of its insufficient severity. The result returned is necessary but not sufficient for writing log messages, that is if the method returns false the message is not going to be written but not vice versa. To this end, the method checks whether the specified severity is equal to or higher than the effective severity of the controller or a severity assigned to the relation of this controller to the one handed over as argument. It does not take into account filters associated with the log controller or logs. This version of the method is less efficient than the version with one argument, and therefore does not fit the purpose to avoid inefficiencies as well.
Parameters:
severity - Severity of message to be written
relative - Related log controller
See Also:
beLogged(int)

beLogged

public boolean beLogged(int severity,
                        LogController[] relatives)
Same as beLogged(int, LogController) but returns true if one of the specified log controllers yields a positive result.
Parameters:
severity - Severity of message to be written
relatives - Related log controllers
See Also:
beLogged(int)

beDebug

public boolean beDebug()
Same as beLogged(int) but always checks for a debug message, that is a message with severity Severity.DEBUG.

beDebug

public boolean beDebug(LogController relative)
Same as beLogged(int, LogController) but always checks for a debug message, that is a message with severity Severity.DEBUG.
Parameters:
relative - Log controller that is related to this one

beDebug

public boolean beDebug(LogController[] relatives)
Same as beLogged(int, LogController[]) but always checks for a debug message, that is a message with severity Severity.DEBUG.
Parameters:
relatives - Log controllers that are related to this one

bePath

public boolean bePath()
Same as beLogged(int) but always checks for a path message, that is a message with severity Severity.PATH.

bePath

public boolean bePath(LogController relative)
Same as beLogged(int, LogController) but always checks for a path message, that is a message with severity Severity.PATH.
Parameters:
relative - Log controller that is related to this one

bePath

public boolean bePath(LogController[] relatives)
Same as beLogged(int, LogController[]) but always checks for a path message, that is a message with severity Severity.PATH.
Parameters:
relatives - Log controllers that are related to this one

beInfo

public boolean beInfo()
Same as beLogged(int) but always checks for an informational message, that is a message with severity Severity.INFO.

beInfo

public boolean beInfo(LogController relative)
Same as beLogged(int, LogController) but always checks for an informational message, that is a message with severity Severity.INFO.
Parameters:
relative - Log controller that is related to this one

beInfo

public boolean beInfo(LogController[] relatives)
Same as beLogged(int, LogController[]) but always checks for an informational message, that is a message with severity Severity.INFO.
Parameters:
relatives - Log controllers that are related to this one

beWarning

public boolean beWarning()
Same as beLogged(int) but always checks for a warning message, that is a message with severity Severity.WARNING.

beWarning

public boolean beWarning(LogController relative)
Same as beLogged(int, LogController) but always checks for a warning message, that is a message with severity Severity.WARNING.
Parameters:
relative - Log controller that is related to this one

beWarning

public boolean beWarning(LogController[] relatives)
Same as beLogged(int, LogController[]) but always checks for a warning message, that is a message with severity Severity.WARNING.
Parameters:
relatives - Log controllers that are related to this one

beError

public boolean beError()
Same as beLogged(int) but always checks for an error message, that is a message with severity Severity.ERROR.

beError

public boolean beError(LogController relative)
Same as beLogged(int, LogController) but always checks for an error message, that is a message with severity Severity.ERROR.
Parameters:
relative - Log controller that is related to this one

beError

public boolean beError(LogController[] relatives)
Same as beLogged(int, LogController[]) but always checks for an error message, that is a message with severity Severity.ERROR.
Parameters:
relatives - Log controllers that are related to this one

beFatal

public boolean beFatal()
Same as beLogged(int) but always checks for a fatal error message, that is a message with severity Severity.FATAL.

beFatal

public boolean beFatal(LogController relative)
Same as beLogged(int, LogController) but always checks for a fatal error message, that is a message with severity Severity.FATAL.
Parameters:
relative - Log controller that is related to this one

beFatal

public boolean beFatal(LogController[] relatives)
Same as beLogged(int, LogController[]) but always checks for a fatal error message, that is a message with severity Severity.FATAL.
Parameters:
relatives - Log controllers that are related to this one

beGroup

public boolean beGroup()
Checks whether a message with group severity would be written via this log controller.
See Also:
beLogged(int)

isActivityTracking

public boolean isActivityTracking()

setActivityTracking

public static void setActivityTracking(ISATChecker value)

getLoggedCount

public int getLoggedCount()

resetLoggedCount

public void resetLoggedCount()

getLoggedCnt

public int getLoggedCnt()