Skip to content
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

Merged
merged 2 commits into from
Feb 17, 2022
Merged

STRF-9658 Add log level variable to control log helper #158

merged 2 commits into from
Feb 17, 2022

Conversation

jairo-bc
Copy link
Contributor

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

*/
constructor(siteSettings, themeSettings, hbVersion, logger = console) {
constructor(siteSettings, themeSettings, hbVersion, logger = console, logLevel = 'info') {
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 gotcha

jmwiese
jmwiese previously approved these changes Feb 17, 2022
* @param {String} level
*/
setLoggerLevel(level) {
this.handlebars.logger.level = level;
Copy link
Contributor

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?

Copy link
Contributor Author

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

@jairo-bc jairo-bc merged commit de3da75 into bigcommerce:master Feb 17, 2022
@jairo-bc jairo-bc mentioned this pull request Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants