Extend console_log Callback
If I'm reading this correctly, the console_log callback does not return the file name of the file that triggered it. Could the callback be extended to include the file name (the file being scanned) and rule name in addition to the string that's returned via the callback?
https://docs.rs/yara-x/1.7.1/src/yara_x/scanner/mod.rs.html#381-387
I put up https://github.com/VirusTotal/yara-x/pull/466 which at least gets the filename in the console.log() output, which is useful when scanning lots of files in a directory. It does not tell you which rule the console.log() call was in, and I'm not sure there is a good way to determine that.
Note that my PR is only changing the scan command to output the filename. This is not exposed in the Scanner in any way because the Scanner does not keep track of the filename being scanned. This means that if you implement your own logic using the scanner you have to do something similar yourself.