-
public class EventLogger
Simple class that can be used to listen to and log out information on all emitted events. By default the BUFFERED_UPDATE, PROGRESS and AD_PROGRESS events are excluded because they are extremely chatty. They can be displayed by calling removeExclude(type).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
EventLogger.LoggerCallback
This interface provides a way implement alternative logging. By default EventLogger writes all messages tologcat. If another method of logging is preferred, a class implementing this interface can be registeredwith either EventLogger or EventLogger and all log messages will besent to that class.
-
Field Summary
Fields Modifier and Type Field Description private boolean
verbose
-
Constructor Summary
Constructors Constructor Description EventLogger(EventEmitter emitterValue, boolean verboseValue)
Creates a new EventLogger object. EventLogger(EventEmitter emitterValue, boolean verboseValue, EventLogger.LoggerCallback callback)
Creates a new EventLogger object. EventLogger(EventEmitter emitterValue, boolean verboseValue, String tagValue)
Creates a new EventLogger object. EventLogger(EventEmitter emitterValue, boolean verboseValue, String tagValue, EventLogger.LoggerCallback callback)
Creates a new EventLogger object.
-
Method Summary
Modifier and Type Method Description void
setVerbose(boolean value)
Sets whether or not properties on events should be logged. void
start()
void
stop()
Stops writing log messages. void
addExclude(String value)
By passing this method a specific EventType, that type will not be logged. void
removeExclude(String value)
Removes an EventType that was previously added with addExclude. void
clearExcludes()
Removes all EventType added with addExclude. void
addWhitelist(String value)
Adds a specific EventType to the whitelist. void
removeFromWhitelist(String value)
Removes a specific EventType from the whitelist. void
clearWhitelist()
Removes all EventType types registered with the whitelist. -
-
Constructor Detail
-
EventLogger
EventLogger(EventEmitter emitterValue, boolean verboseValue)
Creates a new EventLogger object.- Parameters:
emitterValue
- The EventEmitter object to listen for events to log.verboseValue
- If true, will log all the properties for each event.
-
EventLogger
EventLogger(EventEmitter emitterValue, boolean verboseValue, EventLogger.LoggerCallback callback)
Creates a new EventLogger object.- Parameters:
emitterValue
- The EventEmitter object to listen for events to log.verboseValue
- If true, will log all the properties for each event.callback
- A com.brightcove.player.event.EventLogger.LoggerCallback instance which will be calledwhen a message or error should be logged.
-
EventLogger
EventLogger(EventEmitter emitterValue, boolean verboseValue, String tagValue)
Creates a new EventLogger object.- Parameters:
emitterValue
- The EventEmitter object to listen for events to log.verboseValue
- If true, will log all the properties for each event.tagValue
- The name of the tag to use when writing messages to logcat.
-
EventLogger
EventLogger(EventEmitter emitterValue, boolean verboseValue, String tagValue, EventLogger.LoggerCallback callback)
Creates a new EventLogger object.- Parameters:
emitterValue
- The EventEmitter object to listen for events to log.verboseValue
- If true, will log all the properties for each event.tagValue
- The name of the tag to use when writing messages to logcat.callback
- A com.brightcove.player.event.EventLogger.LoggerCallback instance which will be calledwhen a message or error should be logged.
-
-
Method Detail
-
setVerbose
void setVerbose(boolean value)
Sets whether or not properties on events should be logged.
- Parameters:
value
- If true, will log all properties.
-
start
void start()
-
stop
void stop()
Stops writing log messages.
-
addExclude
void addExclude(String value)
By passing this method a specific EventType, that type will not be logged.
- Parameters:
value
- The EventType to exclude from the log.
-
removeExclude
void removeExclude(String value)
Removes an EventType that was previously added with addExclude.
- Parameters:
value
- The EventType to remove.
-
clearExcludes
void clearExcludes()
Removes all EventType added with addExclude.
-
addWhitelist
void addWhitelist(String value)
Adds a specific EventType to the whitelist. If EventTypes are added to the whitelist, ONLY thoseEventTypes will be logged. All other Events will be ignored. By default, no EventTypes are whitelisted.
- Parameters:
value
- The EventType to add to the whitelist.
-
removeFromWhitelist
void removeFromWhitelist(String value)
Removes a specific EventType from the whitelist.
- Parameters:
value
- The EventType to remove.
-
clearWhitelist
void clearWhitelist()
Removes all EventType types registered with the whitelist. After calling this, all EventTypes will belogged (except those registered with addExclude.
-
-
-
-