apache / daffodil-vscode

Apache Daffodilâ„¢ Extension for Visual Studio Code
https://daffodil.apache.org/
Apache License 2.0
11 stars 19 forks source link

dfdlx:trace function output not visible anywhere #116

Open mbeckerle opened 2 years ago

mbeckerle commented 2 years ago

The only way to debug expressions currently is by peppering them with calls to dfdlx:trace(expr, 'info string').

This would normally write "info string" then the value of the expr to stdout or something.

I couldn't find the output in any output tab or log tab in the vscode debugger. This should be console output from the daffodil parser.

To reproduce:

If you take the DFDLSchemas/CSV example, and add

xmlns:dfdlx="http://www.ogf.org/dfdl/dfdl-1.0/extensions" At the top of the csvHeaderEnforced.dfdl.xsd file, then wrap the dfdl:occursCount expression so it looks like: dfdl:occursCount="{ dfdlx:trace(fn:count(../../header/title), 'count: ') }" Then it should output a line of 'count: N' where N is the number of headers. That is once it gets to the item array.

I could not find the word "count" in any output tab.

stevedlawrence commented 2 years ago

Note that the most recent version of Daffodil outputs the dfdlx:trace message to the info log level via Log4J. It's possible the extension is not capturing log4j output and so it's just getting dropped, or maybe the default log level used by the debugger doesn't include the info level.