-
-
Notifications
You must be signed in to change notification settings - Fork 517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
opt-out of logs? #111
Comments
I think this makes sense, the ability to opt-out of logs was voiced in the related ticket (), yet I've went with enabled by default. Thinking out load, the arguments to the function start(options: StartOptions): Promise<ServiceWorkerRegistration| null>
interface StartOptions {
serviceWorker: {
url: string
options: string
}
quiet: boolean
} |
It will be possible to opt out of logs in the next release ( import { composeMocks } from 'msw'
const { start } = composeMocks(...)
start({ quiet: true }) |
Awesome! Thank you :) |
@kentcdodds, could you please update to
|
Just tried and running |
Also, just noticed that this doesn't silence the first log that says I think I'd like all logs gone. |
Oh, and I think the docs here need to be updated: https://redd.gitbook.io/msw/recipes/custom-service-worker-url :) |
Originally, I wanted to leave the activation message intact, so it's always evident the page is handled by the mock service worker. However, since the quiet mode is explicit, I believe there's little harm done in silencing the activation message as well. I'll provide a pull request in a short notice.
What version of |
The activation message should now be silenced as well when using Could you please update to |
0.14.1 works! Thanks! |
Is your feature request related to a problem? Please describe.
In my (edge) use case of having an app where we're pretending there really is a server even though there isn't. I'd prefer to not get anything logged to the console from MSW (unless there's an error).
Describe the solution you'd like
I'd like to be able to disable the logging. Perhaps as an option when I call
start
?Describe alternatives you've considered
I'm considering overriding
console.log
/etc to filter out MSW logs.Additional context
https://bookshelf.lol
The text was updated successfully, but these errors were encountered: