Commit 16802c0
process: add --redirect-warnings command line argument
The --redirect-warnings command line argument allows process warnings
to be written to a specified file rather than printed to stderr.
Also adds an equivalent NODE_REDIRECT_WARNINGS environment variable.
If the specified file cannot be opened or written to for any reason,
the argument is ignored and the warning is printed to stderr.
If the file already exists, it will be appended to.
Backport-PR-URL: #12677
PR-URL: #10116
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Michal Zasso <targos@protonmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>1 parent 2d3e735 commit 16802c0Copy full SHA for 16802c0
File tree
Expand file treeCollapse file tree
8 files changed
+182
-2
lines changedOpen diff view settings
Filter options
- doc
- api
- lib/internal/process
- src
- test/parallel
Expand file treeCollapse file tree
8 files changed
+182
-2
lines changedOpen diff view settings
Collapse file
+21Lines changed: 21 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
122 | 122 | |
123 | 123 | |
124 | 124 | |
| 125 | + |
| 126 | + |
| 127 | + |
| 128 | + |
| 129 | + |
| 130 | + |
| 131 | + |
| 132 | + |
| 133 | + |
| 134 | + |
125 | 135 | |
126 | 136 | |
127 | 137 | |
| ||
383 | 393 | |
384 | 394 | |
385 | 395 | |
| 396 | + |
| 397 | + |
| 398 | + |
| 399 | + |
| 400 | + |
| 401 | + |
| 402 | + |
| 403 | + |
| 404 | + |
| 405 | + |
| 406 | + |
386 | 407 | |
387 | 408 | |
388 | 409 | |
|
Collapse file
+10Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
112 | 112 | |
113 | 113 | |
114 | 114 | |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | + |
115 | 119 | |
116 | 120 | |
117 | 121 | |
| ||
255 | 259 | |
256 | 260 | |
257 | 261 | |
| 262 | + |
| 263 | + |
| 264 | + |
| 265 | + |
| 266 | + |
| 267 | + |
258 | 268 | |
259 | 269 | |
260 | 270 | |
|
Collapse file
lib/internal/process/warning.js
Copy file name to clipboardExpand all lines: lib/internal/process/warning.js+73-2Lines changed: 73 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
4 | 4 | |
5 | 5 | |
6 | 6 | |
| 7 | + |
7 | 8 | |
8 | 9 | |
9 | 10 | |
10 | 11 | |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
11 | 82 | |
12 | 83 | |
13 | 84 | |
| ||
21 | 92 | |
22 | 93 | |
23 | 94 | |
24 | | - |
| 95 | + |
25 | 96 | |
26 | 97 | |
27 | 98 | |
| ||
44 | 115 | |
45 | 116 | |
46 | 117 | |
47 | | - |
| 118 | + |
48 | 119 | |
49 | 120 | |
Collapse file
+13Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
199 | 199 | |
200 | 200 | |
201 | 201 | |
| 202 | + |
202 | 203 | |
203 | 204 | |
204 | 205 | |
205 | 206 | |
206 | 207 | |
207 | 208 | |
| 209 | + |
| 210 | + |
| 211 | + |
208 | 212 | |
209 | 213 | |
210 | 214 | |
| ||
3701 | 3705 | |
3702 | 3706 | |
3703 | 3707 | |
| 3708 | + |
| 3709 | + |
3704 | 3710 | |
3705 | 3711 | |
3706 | 3712 | |
| ||
3765 | 3771 | |
3766 | 3772 | |
3767 | 3773 | |
| 3774 | + |
3768 | 3775 | |
3769 | 3776 | |
3770 | 3777 | |
| ||
3866 | 3873 | |
3867 | 3874 | |
3868 | 3875 | |
| 3876 | + |
| 3877 | + |
3869 | 3878 | |
3870 | 3879 | |
3871 | 3880 | |
| ||
4401 | 4410 | |
4402 | 4411 | |
4403 | 4412 | |
| 4413 | + |
| 4414 | + |
| 4415 | + |
| 4416 | + |
4404 | 4417 | |
4405 | 4418 | |
4406 | 4419 | |
|
Collapse file
+10Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
12 | 12 | |
13 | 13 | |
14 | 14 | |
| 15 | + |
15 | 16 | |
16 | 17 | |
17 | 18 | |
| ||
47 | 48 | |
48 | 49 | |
49 | 50 | |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | + |
50 | 60 | |
51 | 61 | |
52 | 62 | |
|
Collapse file
+5Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
49 | 49 | |
50 | 50 | |
51 | 51 | |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | + |
| 56 | + |
52 | 57 | |
53 | 58 | |
54 | 59 | |
|
Collapse file
test/parallel/test-process-redirect-warnings-env.js
Copy file name to clipboard+25Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
Collapse file
test/parallel/test-process-redirect-warnings.js
Copy file name to clipboard+25Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
0 commit comments