Skip to content

Commit 84b0342

Browse files
committed
[GR-19691] Document --log-process-args
PullRequest: truffleruby/2904
2 parents b29a03c + 4ba1f36 commit 84b0342

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

doc/user/debugging.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,24 @@ When you are interoperating with other languages, including C extensions, backtr
4343

4444
## Printing Subprocesses
4545

46-
You can print all subprocesses created by TruffleRuby using the option `--log-subprocess`.
46+
You can log subprocesses created by TruffleRuby using the option `--log-subprocess`.
4747

4848
```bash
4949
$ ruby --log-subprocess -e '`ls .`'
5050
[ruby] INFO: spawn: ls .
51-
```
51+
```
52+
53+
This is not transitive though, unless you set this option in `TRUFFLERUBYOPT`.
54+
55+
## Printing TruffleRuby Processes and Arguments
56+
57+
You can log TruffleRuby processes created using the `bin/truffleruby` launcher and their arguments with `--log-process-args`.
58+
59+
```bash
60+
$ ruby --log-process-args -e 0
61+
[ruby] INFO: new process: truffleruby --log-process-args -e 0
62+
```
63+
64+
You can set this option in `TRUFFLERUBYOPT` to make it apply to TruffleRuby subprocess as well.
65+
Separate log files will be used for different subprocesses running at the same time when using `--log.file=PATH`.
66+
These log files start with the same path but end with `1`, `2`, etc suffixes.

src/options.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ EXPERT:
102102
PATCHING: [patching, boolean, true, Use patching]
103103
HASHING_DETERMINISTIC: [hashing-deterministic, boolean, false, Produce deterministic hash values]
104104
FIBER_POOL: [fiber-pool, boolean, true, 'Use a thread pool to speed up creating Fibers']
105-
LOG_SUBPROCESS: [log-subprocess, boolean, false, 'Log whenever a subprocess is created']
105+
LOG_SUBPROCESS: [log-subprocess, boolean, false, 'Log whenever a subprocess is created'] # Also see --log-process-args
106106
WARN_LOCALE: [warn-locale, boolean, true, 'Warn when the system locale is not set properly']
107107

108108
# Options to tweak backtraces

0 commit comments

Comments
 (0)