-
Notifications
You must be signed in to change notification settings - Fork 36
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
STRF-9658 Add log level variable to control log helper #158
Conversation
*/ | ||
constructor(siteSettings, themeSettings, hbVersion, logger = console) { | ||
constructor(siteSettings, themeSettings, hbVersion, logger = console, logLevel = 'info') { |
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.
Do we want to make this configurable via environment variable?
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.
yes. it will be in the renderer. It's basically the way to pass down it through libraries
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.
👍 gotcha
* @param {String} level | ||
*/ | ||
setLoggerLevel(level) { | ||
this.handlebars.logger.level = level; |
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.
Not sure that this will work for console
. Can you write a test for that?
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.
sure, added!
This behaviour is possible due to this if condition:
https://github.com/bigcommerce/paper-handlebars/blob/master/index.js#L332
What? Why?
To get ability to log errors from paper and handlebars and fix the issue that caused https://jira.bigcommerce.com/browse/STRF-7500
How was it tested?
npm test, e2e
cc @bigcommerce/storefront-team