Skip to content

Commit

Permalink
include isVideo or isAudio in media picker logs (#27091)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakeii authored Apr 30, 2024
1 parent 382a426 commit 608be24
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions applications/app/services/dotcomrendering/MediaPicker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ object MediaPicker extends GuLogging {
}
}

private def dcrLogFlags(mediaPage: MediaPage): Map[String, String] = {
Map(
("isVideo", mediaPage.media.isInstanceOf[Video].toString()),
("isAudio", mediaPage.media.isInstanceOf[Audio].toString()),
)
}

def getTier(
mediaPage: MediaPage,
)(implicit
Expand All @@ -36,6 +43,7 @@ object MediaPicker extends GuLogging {
// defaulting to false until we are ready to release and create a 0% test
val participatingInTest = ActiveExperiments.isParticipating(DCRVideoPages)
val dcrCanRender = dcrCouldRender(mediaPage)
val flags = dcrLogFlags(mediaPage)

val tier = {
if (request.forceDCROff) LocalRender
Expand All @@ -45,9 +53,9 @@ object MediaPicker extends GuLogging {
}

if (tier == RemoteRender) {
DotcomponentsLogger.logger.logRequest(s"path executing in dotcomponents", Map.empty, mediaPage.media)
DotcomponentsLogger.logger.logRequest(s"path executing in dotcomponents", flags, mediaPage.media)
} else {
DotcomponentsLogger.logger.logRequest(s"path executing in web", Map.empty, mediaPage.media)
DotcomponentsLogger.logger.logRequest(s"path executing in web", flags, mediaPage.media)
}

tier
Expand Down

0 comments on commit 608be24

Please sign in to comment.