I have two questions regarding to get v8 logs while running google chrome:
I have tried to run chrome with the following flags: --js-flags="--log_regexp=true --logfile=~/v8.log"
but I can't find the log file. Even when no specifying --logfile=~/v8.log
and thus letting it be the default v8.log, I can't find the v8.log file. So my question is: where can I find the v8 log file when running it from google chrome.
Another question I have is that in the flags I specified in the first question I used the --log_regexp flag. I saw in here https://gist.github.com/cevek/ef1c9761a67d80d642f98cc75885bf31 that the flag is supported but when running node --v8-options
I couldn't find the flag among the supported flags. So here my question is: do you have an idea if this flag is supported or not/ do you know how to log regexp info with v8?
Thanks for the help!
(V8 developer here.)
Where can I find the V8 log file when running it from Google Chrome?
It should be in the current directory. That said, to get any log files, you have to pass the --no-sandbox
flag to Chrome. By default, renderer processes are not allowed to write to disk, which is an important security safeguard, so it's strongly recommended to only load trusted websites with the sandbox turned off.
Is this flag supported or not?
--log-regexp
is not a supported flag at this time (apparently it used to be supported in earlier versions). If node --v8-options
doesn't list a flag, then that version of Node doesn't support it. (You can find the source for flag definitions at https://chromium.googlesource.com/v8/v8/+/master/src/flags/flag-definitions.h.)
How to log regexp info with V8?
Running node --v8-options | grep regexp
gives a couple of flags that might be relevant for your needs:
$ node --v8-options | grep regexp
--trace-regexp-bytecodes (trace regexp bytecode execution)
--trace-regexp-assembler (trace regexp macro assembler calls.)
--trace-regexp-parser (trace regexp parsing)
--trace-regexp-tier-up (trace regexp tiering up execution)