Skip to content

Commit

Permalink
Update pillarbox-player/src/main/java/ch/srgssr/pillarbox/player/util…
Browse files Browse the repository at this point in the history
…s/PillarboxEventLogger.kt

Co-authored-by: Gaëtan Muller <[email protected]>
  • Loading branch information
StaehliJ and MGaetan89 authored Jun 13, 2024
1 parent b35d2ce commit c942d14
Showing 1 changed file with 2 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,9 @@ class PillarboxEventLogger(private val tag: String = "EventLogger") : EventLogge
private fun getEventString(
eventTime: EventTime,
eventName: String,
eventDescription: String? = null,
throwable: Throwable? = null
eventDescription: String,
): String {
var eventString = eventName + " [" + getEventTimeString(eventTime)
if (throwable is PlaybackException) {
eventString += ", errorCode=" + throwable.errorCodeName
}
if (eventDescription != null) {
eventString += ", $eventDescription"
}
val throwableString = androidx.media3.common.util.Log.getThrowableString(throwable)
if (!TextUtils.isEmpty(throwableString)) {
eventString += """
${throwableString!!.replace("\n", "\n ")}
"""
}
eventString += "]"
return eventString
return "$eventName [${getEventTimeString(eventTime)}, $eventDescription]"
}

private fun getEventTimeString(eventTime: EventTime): String {
Expand Down

0 comments on commit c942d14

Please sign in to comment.