Class EventLogger


  • public class EventLogger
    extends java.lang.Object
    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).
    • Constructor Detail

      • EventLogger

        public 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

        public 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 EventLogger.LoggerCallback instance which will be called when a message or error should be logged.
      • EventLogger

        public EventLogger​(EventEmitter emitterValue,
                           boolean verboseValue,
                           java.lang.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

        public EventLogger​(EventEmitter emitterValue,
                           boolean verboseValue,
                           java.lang.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 EventLogger.LoggerCallback instance which will be called when a message or error should be logged. This can be null.
    • Method Detail

      • setVerbose

        public void setVerbose​(boolean value)
        Sets whether or not properties on events should be logged.
        Parameters:
        value - If true, will log all properties.
      • start

        public void start()
      • stop

        public void stop()
        Stops writing log messages.
      • addExclude

        public void addExclude​(java.lang.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

        public void removeExclude​(java.lang.String value)
        Removes an EventType that was previously added with addExclude(String).
        Parameters:
        value - The EventType to remove.
      • addWhitelist

        public void addWhitelist​(java.lang.String value)
        Adds a specific EventType to the whitelist. If EventTypes are added to the whitelist, ONLY those EventTypes 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

        public void removeFromWhitelist​(java.lang.String value)
        Removes a specific EventType from the whitelist.
        Parameters:
        value - The EventType to remove.
      • clearWhitelist

        public void clearWhitelist()
        Removes all EventType types registered with the whitelist. After calling this, all EventTypes will be logged (except those registered with addExclude(String).