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

custom stringifier doesn't work #15

Closed punund closed 4 years ago

punund commented 4 years ago

I tried the example from the docs:

const obj = { foo: true, bar: 42 }

const log = require ('ololog').configure ({ stringify: { print: require ('q-i').stringify } })
log(obj)

const { stringify } = require('q-i')
console.log(stringify(obj))

It turns out that while q-i works by itself, with ololog it doesn't:

image

xpl commented 4 years ago

@punund Good catch! The print option should now work (let me know if it still doesn't). I've also updated the docs, as there's another way of overriding the stringification that might be also useful to you:

https://github.com/xpl/ololog#using-with-custom-stringifier

wycats commented 3 years ago

@xpl is there a clean way to override just the object printing (and leave stacktracey formatting for exceptions)?