cli icon indicating copy to clipboard operation
cli copied to clipboard

Silence chromium download progress log

Open joshkg opened this issue 2 years ago • 4 comments

When Percy downloads Chromium during asset discovery, the download progress log spams our CI with messages like:

Downloading Chromium 929511...percy] Downloading Chromium 929511 [                    ] 332B/142.9MB 0% 00:00percy] Downloading Chromium 929511 [                    ] 1.7kB/142.9MB 0% 00:00percy] Downloading Chromium 929511 [                    ] 3.0kB/142.9MB 0% 00:00percy] Downloading Chromium 929511 [                    ] 4.4kB/142.9MB 0% 00:34percy] Downloading Chromium 929511 [                    ] 5.7kB/142.9MB 0% 00:26percy] Downloading Chromium 929511 [                    ] 7.1kB/142.9MB 0% 00:21percy] Downloading Chromium 929511 [                    ] 8.4kB/142.9MB 0% 00:17percy] Downloading Chromium 929511 [                    ] 9.7kB/142.9MB 0% 00:15percy]

Is it possible to silence this?

joshkg avatar Dec 21 '22 01:12 joshkg

There is no way to hide only these logs for now. You can set the PERCY_LOGLEVEL env variable using something like cross-env to suppress the logs.

One workaround is skipping the download altogether by downloading it on your CI yourself (ref doc)

samarsault avatar Dec 21 '22 06:12 samarsault

@samarsault thanks for the quick reply -- I will investigate these options!

joshkg avatar Dec 21 '22 17:12 joshkg

Hey @joshkg 👋

  • does the link solve your issue?
  • you may use --silent flag to silence these logs or use PERCY_DEBUG env var to whitelist only certain packages to log.

itsjwala avatar Jan 03 '23 14:01 itsjwala

@itsjwala I've tried a few options now, here's my initial assessment:

  • setting PERCY_LOGLEVEL to warn removes the download progress messaging, but also removes the other info-level messages we'd like to continue seeing (same issue as using --silent flag)
  • moving the download of the chromium browser outside of the Percy install also works. However this is not ideal, as it requires us to monitor browser version changes when the package is upgraded (I could foresee the possibility that we forget the connection between percy & this download and get out of sync in the future)
  • using the PERCY_DEBUG variable to whitelist just core and core:browser like the following value: PERCY_DEBUG="core,core:browser" seems to be the closest to what I'm after -- it adds a line per test of percy messaging we didn't have before. that we don't want, but it maintains the rest of the info level messaging we want to keep, and removes the install debug level (and others) that we don't want to see.

Poking around in the logger source, maybe just an option to exclude the logger.progress messaging would be the most exact solution, if anyone wants to address this as an enhancement - I don't know how common this particular logging issue is, perhaps its only an issue on Semaphore CI.

joshkg avatar Jan 05 '23 00:01 joshkg