Unverified Commit 5449196b authored by JonLuca De Caro's avatar JonLuca De Caro Committed by GitHub

chore(logging): Disable info logging of critters in production (#62776)

Critters uses the `info` logLevel by default. This means that when you
enable the experimental `optimizeCss` property, your production logs
will be polluted with their logs

This sets the log level to warn by default in production, and allows
configuration via an environment variable

![CleanShot 2024-03-02 at 18 12
46@2x](https://github.com/vercel/next.js/assets/13029040/aca150e2-31e5-4a3d-a01d-91fce0590c1e)

---------
Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
parent 03821625
......@@ -242,6 +242,9 @@ async function postProcessHTML(
publicPath: `${renderOpts.assetPrefix}/_next/`,
preload: 'media',
fonts: false,
logLevel:
process.env.CRITTERS_LOG_LEVEL ||
(process.env.NODE_ENV === 'production' ? 'warn' : 'info'),
...renderOpts.optimizeCss,
})
return await cssOptimizer.process(html)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment