soo-logger

1.0.2 • Public • Published

soo-logger

Screw [Object, Object]

I hate trying to debug with the console and only seeing partial data, with the rest falling into [Object] blocks. This is an attempt to fix that.

soo-logger turns this:

{ dog:
   { name: 'kylo',
     breeds: [ [Object], [Object] ],
     siblings: [ [Object] ] } }

into this:

{
  "dog": {
    "name": "kylo",
    "breeds": [
      {
        "breed": "Lab"
      },
      {
        "breed": "Pit Bull"
      }
    ],
    "siblings": [
      {
        "name": "Leia",
        "breeds": [
          {
            "breed": "Border Collie"
          }
        ]
      }
    ]
  }
}

Usage:

$ yarn add soo-logger
const soo = require('soo-logger');

const data = {
  dog: {
    name: 'kylo',
    breeds: [
      {
        breed: 'Lab',
      },
      {
        breed: 'Pit Bull',
      },
      {
        breed: 'Doofus',
      },
    ],
  },
};

console.log(data) // => Prints garbage.
soo(data); // => Prints what you would expect.

Readme

Keywords

none

Package Sidebar

Install

npm i soo-logger

Weekly Downloads

0

Version

1.0.2

License

MIT

Last publish

Collaborators

  • fbguillo