Commit 08b8f37
committed
Remove Warning: prefix and toString on console Arguments (#29839)
Basically make `console.error` and `console.warn` behave like normal -
when a component stack isn't appended. I need this because I need to be
able to print rich logs with the component stack option and to be able
to disable instrumentation completely in `console.createTask`
environments that don't need it.
Currently we can't print logs with richer objects because they're
toString:ed first. In practice, pretty much all arguments we log are
already toString:ed so it's not necessary anyway. Some might be like a
number. So it would only be a problem if some environment can't handle
proper consoles but then it's up to that environment to toString it
before logging.
The `Warning: ` prefix is historic and is both noisy and confusing. It's
mostly unnecessary since the UI surrounding `console.error` and
`console.warn` tend to have visual treatment around it anyway. However,
it's actively misleading when `console.error` gets prefixed with a
Warning that we consider an error level. There's an argument to be made
that some of our `console.error` don't make the bar for an error but
then the argument is to downgrade each of those to `console.warn` - not
to brand all our actual error logging with `Warning: `.
Apparently something needs to change in React Native before landing this
because it depends on the prefix somehow which probably doesn't make
sense already.
DiffTrain build for [2774208](2774208)1 parent fcd1411 commit 08b8f37
File tree
35 files changed
+97
-97
lines changed- compiled/facebook-www
- __test_utils__
35 files changed
+97
-97
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1980 | 1980 | | |
1981 | 1981 | | |
1982 | 1982 | | |
1983 | | - | |
| 1983 | + | |
1984 | 1984 | | |
1985 | 1985 | | |
1986 | 1986 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1960 | 1960 | | |
1961 | 1961 | | |
1962 | 1962 | | |
1963 | | - | |
| 1963 | + | |
1964 | 1964 | | |
1965 | 1965 | | |
1966 | 1966 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
665 | 665 | | |
666 | 666 | | |
667 | 667 | | |
668 | | - | |
| 668 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
665 | 665 | | |
666 | 666 | | |
667 | 667 | | |
668 | | - | |
| 668 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
669 | 669 | | |
670 | 670 | | |
671 | 671 | | |
672 | | - | |
| 672 | + | |
673 | 673 | | |
674 | 674 | | |
675 | 675 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
669 | 669 | | |
670 | 670 | | |
671 | 671 | | |
672 | | - | |
| 672 | + | |
673 | 673 | | |
674 | 674 | | |
675 | 675 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16922 | 16922 | | |
16923 | 16923 | | |
16924 | 16924 | | |
16925 | | - | |
| 16925 | + | |
16926 | 16926 | | |
16927 | 16927 | | |
16928 | 16928 | | |
16929 | 16929 | | |
16930 | 16930 | | |
16931 | 16931 | | |
16932 | | - | |
| 16932 | + | |
16933 | 16933 | | |
16934 | 16934 | | |
16935 | 16935 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16362 | 16362 | | |
16363 | 16363 | | |
16364 | 16364 | | |
16365 | | - | |
| 16365 | + | |
16366 | 16366 | | |
16367 | 16367 | | |
16368 | 16368 | | |
16369 | 16369 | | |
16370 | 16370 | | |
16371 | 16371 | | |
16372 | | - | |
| 16372 | + | |
16373 | 16373 | | |
16374 | 16374 | | |
16375 | 16375 | | |
| |||
0 commit comments