-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Core: Add option to remove logs from the console #8461
Comments
I see that it's possible to filter these logs(#252 (comment)). But maybe storybook has its own configuration for it? |
AFAIK the recommended approach is to use the browser's filter function |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
I would prefer to have this filtered out by storybook, because regular expressions are difficult for some users, especially the lookaheads. Also, there's always some message that sneaks into the log anyway because the regex didn't cover it. Lastly, it looks bad for a framework like this to print out random console logs by default and leave users deal with it. --clientLogLevel=silent would be sufficient in the CLI. |
I think the production version of this should have no logs output to the console. If run in dev mode when developing an add-on it should output logs. |
I think that the main purpose of the storybook is to develop simple and reusable components, not add-ons. And when you are developing components, you usually don't need internal storybook logs to cause it can litter console (a lot of developers are using console as their main debugger tool). |
When I mean "dev mode" I mean developing storybooks features. Not developing with Storybook like most of us. End users should see no logs. |
What's wrong with disabling verbose logging in the browser? Storybook is a dev tool. It doesn't run in your app. |
@shilman one of the great uses of Storybook is developing components in isolation--it's not unreasonable to want logs from your components as you are building it, but not logs from the harness. |
Please let us get rid of these logs! :) |
@shilman I propose we add something global that enables and disables logging in the browser from storybook. The setting could be initiated from env-var or from url. We want to have the ability to flick this setting ON for debugging people's build storybook. |
I don't exactly understand. Is there any way to remove the console.log yet? |
No sorry, I was commenting on how we should implement this. |
Okay. Thanks |
As @shilman suggests, one can manage these logs in the browser console. However, I think Storybook should provide a way to config these log levels. The info logs provide little to no value to the developer. Providing a |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
I don't like this logs too, so irrelevant during development, for now, I m removing the related code from logger file to prevent this messages, but I have to do this every time installing new package. |
Storybook seems to be our primary stackless development workflow. Move the `storybook` script to `start` to support the standard `npm start` command expected in every NPM repo. Debugging Storybook tooling is the rare case that informational messages (perhaps even more verbose than default) are wanted. Feature development is the common workflow that should be optimized for. Storybook's design philosophy seems to favor incredibly verbose output by default, both for the CLI and the [browser console]. This is at odds with Unix's rule of silence, sometimes expressed as "silence is golden." That is, only report warnings and errors unless told otherwise. This patch reduces the verbosity of the Storybook [CLIs] as able and its setup script: - Only report warnings and errors while building. - Suppress build informational output when launching. - Only report curl errors, not progress. [browser console]: storybookjs/storybook#8461 [CLIs]: https://storybook.js.org/docs/configurations/cli-options/ Change-Id: Ie38ae14e304f7f88f445c0c0fb3f2fbba49d134a
* Update Vector from branch 'master' to 14abeb0c2f9583772e5ec2134a2c2de97c99e165 - [dev][Storybook] move to start script; report errors not status Storybook seems to be our primary stackless development workflow. Move the `storybook` script to `start` to support the standard `npm start` command expected in every NPM repo. Debugging Storybook tooling is the rare case that informational messages (perhaps even more verbose than default) are wanted. Feature development is the common workflow that should be optimized for. Storybook's design philosophy seems to favor incredibly verbose output by default, both for the CLI and the [browser console]. This is at odds with Unix's rule of silence, sometimes expressed as "silence is golden." That is, only report warnings and errors unless told otherwise. This patch reduces the verbosity of the Storybook [CLIs] as able and its setup script: - Only report warnings and errors while building. - Suppress build informational output when launching. - Only report curl errors, not progress. [browser console]: storybookjs/storybook#8461 [CLIs]: https://storybook.js.org/docs/configurations/cli-options/ Change-Id: Ie38ae14e304f7f88f445c0c0fb3f2fbba49d134a
Yo-ho-ho!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-beta.21 containing PR #10370 that references this issue. Upgrade today to try it out! You can find this prerelease on the Closing this issue. Please re-open if you think there's still more to do. |
Thank you, @shilman! I do not see the Storybook info logs \o/ I had a quick question about HMR logs as those still appear:
Do you know if this setting should have effect or is that new ticket? I tried the following: module.exports = {
...,
// Only report warnings and errors in the browser console.
logLevel: 'warn',
webpackFinal( config ) {
config.stats = 'errors-warnings';
// Try to suppress HMR messaging.
config.devServer = {
...config.devServer,
clientLogLevel: 'warning',
overlay: { warnings: true, errors: true },
noInfo: true,
progress: false,
stats: 'errors-warnings'
};
return config;
}
}; Thank you!! |
I think that's a question for @ndelangen |
I think we could pass down the logLevel down to |
Thank you, @ndelangen and @shilman! I hope you don't mind but I've used |
Son of a gun!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-beta.24 containing PR #11087 that references this issue. Upgrade today to try it out! You can find this prerelease on the |
Hi!
I have added a storybook to my project but there are a lot of internal storybook logs in the browser console. Are there any ways to remove it? I have noticed that these logs produced by
@storybook/client-logger
but I didn't find how to disable it/provide some config to change itUsed
npx -p @storybook/cli sb init --type react
to add storybook to my project.Packages which have been installed during setup
Screenshot: https://monosnap.com/file/RCHP51RZvcZeIf6pGJH4UP2wdKfc6G
The text was updated successfully, but these errors were encountered: