Package com.mendix.logging
Class LogSubscriber
java.lang.Object
java.util.Observable
com.mendix.logging.LogSubscriber
Provides the interfaces for any log subscriber, including custom ones.
-
Constructor Summary
ConstructorDescriptionLogSubscriber
(String name, LogLevel autoSubscribeLevel) Creates a new log subscriber with a name and log level. -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Terminates this subscriber and unsubscribes from all log nodes.Returns the log level that will be used to automatically subscribe to new log nodes.Returns the description of this log subscriber.getName()
Returns the name of this log subscriber.Returns all log nodes that this subscriber subscribed to and the corresponding log levels.abstract void
processMessage
(LogMessage message) Method that is called for each log message that is logged.void
setAutoSubscribeLevel
(LogLevel level) Sets the log level to which to subscribe to automatically.void
Subscribes this subscriber to the specified log node at the specified level.void
Unsubscribes this subscriber from all subscribed log nodes.void
unsubscribe
(ILogNode node) Unsubscribes this subscriber from the specified log node.Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Constructor Details
-
LogSubscriber
Creates a new log subscriber with a name and log level.- Parameters:
name
- the name of the log subscriberautoSubscribeLevel
- the log level to subscribe to
-
-
Method Details
-
getName
Returns the name of this log subscriber.- Returns:
- the name
-
getDescription
Returns the description of this log subscriber.- Returns:
- the description
-
processMessage
Method that is called for each log message that is logged.- Parameters:
message
- the log message to process
-
getAutoSubscribeLevel
Returns the log level that will be used to automatically subscribe to new log nodes.- Returns:
- the log level
-
setAutoSubscribeLevel
Sets the log level to which to subscribe to automatically.- Parameters:
level
- the log level to set
-
subscribe
Subscribes this subscriber to the specified log node at the specified level.- Parameters:
node
- the log node to subscribe tolevel
- the log level at which to subscribe
-
unsubscribe
Unsubscribes this subscriber from the specified log node.- Parameters:
node
- the log node to subscribe to
-
unsubscribe
public void unsubscribe()Unsubscribes this subscriber from all subscribed log nodes. -
destroy
public void destroy()Terminates this subscriber and unsubscribes from all log nodes. -
getSubscriptions
Returns all log nodes that this subscriber subscribed to and the corresponding log levels.- Returns:
- the subscriptions and their log level
-