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

Document `yes` switch for custom (time) printer #4

Closed mustardamus closed 6 years ago

mustardamus commented 6 years ago

If you follow the documentation for the custom printer for timestamps (https://github.com/xpl/ololog#timestamping), it will show you nothing. That is because the example code lacks the yes switch you need to enable the custom printer.

So this current example:

log.configure ({ time: { print: x => (String (x) + ' | ').bright.cyan }}) ('Lorem ipsum dolor sit amet\nconsectetur adipiscing elit..')

Should be (added yes: true):

log.configure ({ time: { yes: true, print: x => (String (x) + ' | ').bright.cyan }}) ('Lorem ipsum dolor sit amet\nconsectetur adipiscing elit..')

Not sure if it applies to other custom printers as well. It works without the yes on the locate custom printer.

xpl commented 6 years ago

Thank you for pointing that out, fixed!

xpl commented 6 years ago

It works without the yes on the locate custom printer.

This is because the location printer is turned on by default, while the timestamp printer is not. You can turn these things on and off with yes. Here's a bit of documentation on that topic.