Closed kenn closed 7 months ago
There is a silent
option which you might be looking for.
There is a
silent
option which you might be looking for.
Thanks! It says suppress all logs, which sounds a bit too aggressive. Does that still prints important logs such as errors? If so that's what I was looking for!
So if something throws, it should still be shown as part of the Node.js stack trace, but it will silence all logs, including error log messages.
You could use the errorHandler
option to still log in case something errors out.
We do not intend to add some sort of log level option as of now I should add.
Got it. Now my config looks like this. Thanks!
export default defineConfig(({ mode }) => {
return {
build: {
sourcemap: true,
},
plugins: [
remix(),
tsconfigPaths(),
sentryVitePlugin({
org: 'org',
project: 'project',
authToken: process.env.SENTRY_AUTH_TOKEN,
sourcemaps: {
filesToDeleteAfterUpload: ['./build/**/*.js.map'],
},
telemetry: mode === 'production',
// debug: mode === 'production', // to check if filesToDeleteAfterUpload works as expected
silent: mode !== 'production',
errorHandler: (err) => {
console.warn(err)
},
}),
],
}
})
Closing this since I think you solved the problem. Feel free to ping me in case you have any other questions!
Environment
@sentry/vite-plugin
2.16.1
Steps to Reproduce
vite.config.ts
as follows:Now, starting the dev server by
npm run dev
prints[sentry-vite-plugin]
and there's no way to silence it. It even prints duplicates.I can actually silence
telemetry
by enabling thetelemetry: mode === 'production'
config as shown above, but there's no way to silence.env.sentry-build-plugin
?Expected Result
Silence all of those.
Actual Result