vite icon indicating copy to clipboard operation
vite copied to clipboard

logLevel not honored client-side

Open bendytree opened this issue 7 months ago • 2 comments

Describe the bug

Looking for a way to silence [vite] ... logs client side in dev and found logLevel under Shared Options, but it doesn't work for client-side vite logs:

export default defineConfig({
  logLevel: 'silent'
});

Results in:

[vite] connecting...
[vite] connected.

Reproduction

https://stackblitz.com/edit/vitejs-vite-abxahfbz?file=vite.config.json

Steps to reproduce

Add logLevel: 'silent' to vite config & reload.

System Info

System:
    OS: macOS 15.4.1
    CPU: (16) arm64 Apple M4 Max
    Memory: 19.31 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.11.0 - ~/.nvm/versions/node/v22.11.0/bin/node
    npm: 10.9.0 - ~/.nvm/versions/node/v22.11.0/bin/npm
    pnpm: 10.4.1 - ~/.nvm/versions/node/v22.11.0/bin/pnpm
  Browsers:
    Chrome: 136.0.7103.114
    Safari: 18.4
    Safari Technology Preview: 18.4
  npmPackages:
    @vitejs/plugin-vue: ^4.2.3 => 4.6.2 
    vite: ^4.3.9 => 4.5.14

Used Package Manager

npm

Logs

[vite] connecting...
[vite] connected.

Validations

bendytree avatar May 20 '25 17:05 bendytree

It only works for the server-side. Is there a reason you want to apply them in the client too? For those logs you mentioned specifically, those are logged with console.debug which you can filter away from the devtools console.

bluwy avatar May 21 '25 01:05 bluwy

Just trying to keep the console clean and meaningful. Most libs provide a flag to disable noisy logs.

bendytree avatar May 25 '25 15:05 bendytree