cli
cli copied to clipboard
Silence chromium download progress log
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?
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 thanks for the quick reply -- I will investigate these options!
Hey @joshkg 👋
- does the link solve your issue?
- you may use
--silentflag to silence these logs or usePERCY_DEBUGenv var to whitelist only certain packages to log.
@itsjwala I've tried a few options now, here's my initial assessment:
- setting
PERCY_LOGLEVELtowarnremoves the download progress messaging, but also removes the otherinfo-level messages we'd like to continue seeing (same issue as using--silentflag) - 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_DEBUGvariable to whitelist justcoreandcore:browserlike 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 theinfolevel messaging we want to keep, and removes theinstalldebug 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.