Increase depth of function logs

Is it possible, when using console.log within a function, and viewing in the logs via the UI, to increase the depth of the log? Currently for an array within an array of objects I simply get variants: [Array] – any thoughts?

@richgcook Note that I’ve not tested this specifically with Netlify functions so can’t speak to precisely how it outputs, but have you tried logging the object as a string instead?

For example:

console.log( JSON.stringify( object, null, 2 ) )

Documentation:

Especially as what you’re experiencing isn’t so much the “depth of the function logs” as it is just how console.log itself works.

According to this stack overflow you could also try console.dir:

2 Likes

Thank you, @nathanmartin – I went with console.dir in the end :slight_smile: