Hey guys, does anyone know why `console.log` state...
# help
c
Hey guys, does anyone know why
console.log
statements are not logging nested objects? See:
[Object]
below. Is this a cloudwatch thing? Or an SST thing? This statement was pulled from cloudwatch but it is the same locally.
Copy code
{
  level: 'INFO',
  message: 'Request received',
  timestamp: '2022-06-23T14:00:35.483Z',
  additional: {
    raw_request: {
      version: '2.0',
      routeKey: 'POST /',
      rawPath: '/',
      rawQueryString: '',
      headers: [Object],
      requestContext: [Object] 
    }
  }
}
d
This is a javascript thing,
console
provides two levels. If you need more levels, you can use
JSON.stringify
.
c
Whaaaat. I never knew that wow
#amateurhour
t
JSON.stringify(thing, null, 4)
if you want it pretty