Skip to content

Commit d3b8284

Browse files
committed
[console] Serialize logged objects only two levels deep instead of 10
Some objects that are both wide and deep like React FiberNodes can't be serialized reasonably when going down 10 levels deep. We address this in our pretty-format plugin in the Expo remote console, but RN's console polyfill doesn't deal with FiberNodes. Printing objects just two levels deep addresses this issue while still logging deeper objects to the Expo remote console and to the native console if one exists.
1 parent d41bc86 commit d3b8284

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: Libraries/polyfills/console.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ function getNativeLogFunction(level) {
408408
} else {
409409
str = Array.prototype.map
410410
.call(arguments, function(arg) {
411-
return inspect(arg, {depth: 10});
411+
return inspect(arg, {depth: 2});
412412
})
413413
.join(', ');
414414
}

0 commit comments

Comments
 (0)