Skip to content

Commit

Permalink
[console] Serialize logged objects only two levels deep instead of 10
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ide committed Nov 9, 2018
1 parent d41bc86 commit d3b8284
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Libraries/polyfills/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ function getNativeLogFunction(level) {
} else {
str = Array.prototype.map
.call(arguments, function(arg) {
return inspect(arg, {depth: 10});
return inspect(arg, {depth: 2});
})
.join(', ');
}
Expand Down

0 comments on commit d3b8284

Please sign in to comment.