Allows StreamLink log messages to be written to the destination of your choice.
You obtain an instance of caplin.streamlink.Logger
by calling
streamLinkInstance.getLogger()
on the StreamLink instance.
StreamLinkJS only:
When suitably configured (by adding ?debug=finer
to your url),
StreamLink's log messages are automatically written to a dedicated
window (the StreamLink Console). You would normally only enable this facility for debug purposes.
You can call the Logger.log() method to write your own log messages to the StreamLink Console.
You can use caplin.streamlink.Logger
to write StreamLink's log messages to some
other destination, such as a window that also contains log messages originating from your application.
To do this, implement a caplin.streamlink.LogListener that receives the StreamLink
messages and logs them to the required destination. Then obtain an instance of caplin.streamlink.Logger,
and call addListener() to attach your Log Listener
to this instance. For a code example showing this, see
caplin.streamlink.LogListener.
Attributes | Name and Description |
---|---|
|
caplin.streamlink.Logger()
|
Attributes | Name and Description |
---|---|
|
void
addListener(caplin.streamlink.LogListener listener, caplin.streamlink.LogLevel level)
Adds a caplin.streamlink.LogListener to this Logger. |
|
void
log(caplin.streamlink.LogLevel level, String message, java.lang.Object args)
Sends a log message to all caplin.streamlink.LogListener's that have been registered for this log level or above. |
|
void
removeListener(caplin.streamlink.LogListener listener)
Removes a caplin.streamlink.LogListener that you previously added (see |
►
caplin.streamlink.Logger()
►
void
addListener(caplin.streamlink.LogListener listener, caplin.streamlink.LogLevel level)
Adds a caplin.streamlink.LogListener to this Logger. The listener is called whenever a StreamLink message with the defined caplin.streamlink.LogLevel is to be logged.
caplin.streamlink.LogListener | listener | The object that implements the caplin.streamlink.LogListener Interface. |
caplin.streamlink.LogLevel | level | The caplin.streamlink.LogLevel of log messages for which the listener is to be called. Only messages at or above this log level will invoke this listener . |
►
void
log(caplin.streamlink.LogLevel level, String message, java.lang.Object args)
Sends a log message to all caplin.streamlink.LogListener's that have been registered for this log level or above.
The log()
method allows inline replacement of arguments. The arguments to replace these placeholders are then passed in at the end.
Example : logger.log(caplin.streamlink.LogLevel.Critical, "Error {0} has occurred with code {1}.", errorString, errorCode);
caplin.streamlink.LogLevel | level | The logging level that will be associated with the logged message. |
String | message | The message to log. |
java.lang.Object | args | Arguments included in the log message. |
►
void
removeListener(caplin.streamlink.LogListener listener)
Removes a caplin.streamlink.LogListener that you previously added (see addListener
).
caplin.streamlink.LogListener | listener | The caplin.streamlink.LogListener you added. |