xpl / ololog

A better console.log for the log-driven debugging junkies
https://www.npmjs.com/package/ololog
The Unlicense
215 stars 8 forks source link

stringify doesn't work in this case, I think #17

Closed llaenowyd closed 4 years ago

llaenowyd commented 4 years ago

Context is

Transpiled with babel:

    "@babel/plugin-transform-runtime": "^7.9.6",
    "@babel/runtime": "^7.10.2",
    "@babel/cli": "^7.8.4",
    "@babel/core": "^7.10.2",
    "@babel/preset-env": "^7.10.2",

while NODE_ENV=development

import { URL } from 'url';
import ololog from 'ololog';

const log =   ololog.configure({
    stringify: { fancy: false, indentation: '  ', maxDepth: 9, maxStringLength: 135 },
  })

log(new URL('http://www.fml.com')); // <-- just want that one to work
log((new URL('http://www.fml.com')).toString());
log(JSON.stringify(new URL('http://www.fml.com')));

outputs:

{  } (<anonymous> @ apis.js:41)
http://www.fml.com/ (<anonymous> @ apis.js:42)
"http://www.fml.com/" (<anonymous> @ apis.js:43)
xpl commented 4 years ago

Yep, the support for URL wasn't there. It is there now (I've just added it). Please update to 1.1.157.

llaenowyd commented 4 years ago

confirmed, thanks! 🎯