-
Notifications
You must be signed in to change notification settings - Fork 87
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
feat: Add a logger to embed init options #732
base: next
Are you sure you want to change the base?
Conversation
src/embed.ts
Outdated
@@ -10,6 +10,8 @@ import { | |||
isString, | |||
Loader, | |||
LoaderOptions, | |||
logger as VgLogger, |
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.
logger as VgLogger, | |
logger as vegaLogger, |
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.
We should also pass the logger to Vega-Lite.
Please add a test as well.
Co-authored-by: Dominik Moritz <[email protected]>
Isn't it already done since the part that adds the logger works with both Vega and Vega-Lite specs ? The mode having been guessed a few lines before. |
I don't think it is. We call |
@challet can you finish up the pull request? |
@@ -304,7 +304,7 @@ async function _embed( | |||
|
|||
const mode = guessMode(spec, opts.mode); | |||
|
|||
let vgSpec: VgSpec = PREPROCESSOR[mode](spec, config); | |||
let vgSpec: VgSpec = PREPROCESSOR[mode](spec, { ...config, logger }); |
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.
Can be added directly to the passed config, since the whole arg will be discarded when the mode is not 'vega-lite'
@domoritz sorry it went out of my scope. I haven't added a test for the last change though and I will have a closer look at it. |
Thank you. Can you make sure the test pass? |
Ping @challet |
Sorry, I will have a look in the next days. |
Add an option to the
embed
function.It allows to pass a custom logger to the view.