I cannot seem to get debug messages to show up in vega in kibana. The docs say I can use the functions warn(), info(), and debug() in expressions and they will print to the console which I assumed is the browser developer console. I cannot get these to work in the vega spec but have only been able to get warn to work somewhat in the developer console.
I understand what I have now doesn't work. I have tried many different combinations in the spec of setting logLevel and calling warn and none work.
My spec so far has:
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
...
"marks":[
{
"on":[
{
"trigger":"vega.logLevel(vega.Warn);vega.warn('trigger run');",
"modify":"warn('modify1, run');",
"values":"warn('values1, run');"
},
{
"trigger":"vega.logger.level('info');warn('trigger run');",
"modify":"warn('modify1, run');",
"values":"warn('values1, run');"
}
}
],
...
}
The only thing I have gotten to work is going into the developer console. I have not been able to get info() or debug() to work likely because I don't know how to set the logLevel correctly:
VEGA_DEBUG.view.warn("This is a warning");
What does a user need to do to output messages using these debug functions? How does one set the logLevel correctly?
I am not sure Vega expressions have access to the browser's console logging functions like console.warn, console.info, and console.debug directly.
Instead, you could use the datum object to pass the message data and handle the logging in your JavaScript code that interacts with the Vega view. Not sure if this is possible with Kibana though. Have a go..
Happy charting!
Adam