## Using events for logs

All state updates of the Android Player are published through the `EventEmitter` interface which is implemented by all main components of the Player: the `Player` and the` Source` for playback as well as the `OfflineContentManager` for downloading content for offline playback.

Apart from the events that indicate a specific state change in the respective component, there are three more general events that are especially useful for logging:

  • The `Error` event signals a fatal error that can not automatically be recovered from.

  • The `Warning` event is emitted if something unexpected happens but core functionality is expected to continue.

  • The `Info` event which contains additional neutral information.

## Example

In the following code snippet, error, warning and info events from the player and source are logged to the console.

The events also enable more complex logging scenario such as e.g. logging only failed downloads:

A more in-depth logging implementation can be found in the [sample projects](🔗).