-
-
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 logLevel preset property to filter logging #10370
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but a few questions
No idea why puppeteer is all of a sudden not able to find the globals anymore, and use them to extract. When I run it locally it works. |
# Conflicts: # yarn.lock
# Conflicts: # yarn.lock
it's not used anywhere I think, but we're getting quite a few 'invalid cli option' errors, and this should get rid of them.
debug: (message: any, ...rest: any[]): void => console.debug(message, ...rest), | ||
log: (message: any, ...rest: any[]): void => console.log(message, ...rest), | ||
log: (message: any, ...rest: any[]): void => window.console.log(message, ...rest), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pretty surprising, what's up with this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log
has no "level" to it. it's not part of console
lib.
I could decide to make log
equal to info
?
@ndelangen I think the most likely situation is that the storybook is throwing an error as it loads in puppeteer and we aren't seeing the error. Try adding: this.page.on('console', (msg) => {
const type = msg.type();
logger.info({ browserConsole: true, type, ...msg.location() }, msg.text());
}); Either that or get a build storybook off one of the CI machines (I have one here) |
# Conflicts: # lib/cli/src/extract.ts # lib/client-logger/src/index.ts # yarn.lock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM does this need documentation somewhere?
I added documentation and the ability to set a value for this from the cli |
Issue: #8461
What I did
ADD logLevel preset property (default is
info
)ADD global variable injection
ADD filter for lower level log messages
ADD a global method for changing the logLevel at runtime.