You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the purpose of this pull request? (put "X" next to an item, remove the rest)
• [ ] Documentation update
• [ ] Bug fix
• [ ] New feature
• [ ] Enhancement to an existing feature
• [X] Other, please explain: Finishing up a todo from #1057
What is the rationale for this request?
This is a follow up to #1057 where console.warn is used instead of logger.warn due to a bug as raised in #1060. The test no long fail in #1117 by mocking logger in the parser.test.js. Although the approach could be improved.
What changes did you make? (Give an overview)
Replaced all console.warn with logger.warn as indicated by the TODO signposts.
Testing instructions:
Run tests to check if anything regressed
should we fix the root cause of the tests failing first instead? ( mocking fs for winston )
Even if we fix the root cause, we would still have to do this change. Therefore, I thought of doing it now since the bug is fixed, albeit not as ideally. 😄
Yes, think we could remove it completely though, and all instances of errorHandler being passed as an option into the parser constructor. It was likely a workaround for the root problem
Yes, think we could remove it completely though, and all instances of errorHandler being passed as an option into the parser constructor. It was likely a workaround for the root problem
Hm, not entirely sure what you mean. _onError is also used in part relating to componentPreprocessor.preProcessComponent()
Hm, not entirely sure what you mean. _onError is also used in part relating to componentPreprocessor.preProcessComponent()
It's a workaround for not being to import logger directly in parser
when we the unit test is run, _onError defaults to console.error
when running anything else from a user standpoint ( e.g. markbind build ), errorHandler is set to logger.error. Should be unncessary with the changes here now
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of this pull request? (put "X" next to an item, remove the rest)
• [ ] Documentation update
• [ ] Bug fix
• [ ] New feature
• [ ] Enhancement to an existing feature
• [X] Other, please explain: Finishing up a todo from #1057
What is the rationale for this request?
This is a follow up to #1057 where
console.warnis used instead oflogger.warndue to a bug as raised in #1060. The test no long fail in #1117 by mocking logger in theparser.test.js. Although the approach could be improved.What changes did you make? (Give an overview)
Replaced all
console.warnwithlogger.warnas indicated by the TODO signposts.Testing instructions:
Run tests to check if anything regressed
markbind servethe example code in the gist.https://gist.github.com/nbriannl/5c44b3ee8a8af78c45a7a4f3659ce196
You should now see

Proposed commit message: (wrap lines at 72 characters)
Replace console.warn with logger.warn,
A follow up to #1057.
Let us also remove console.error as the error handler
And directly set the error handler to be logger during init