Closed ourarash closed 6 years ago
I was able to do it this way:
const log = require("ololog").configure({ time: { yes: true, print: x => ( x.toLocaleString() + ' | ') }});
@ourarash Thank you for the suggestion. Here you go (see the updated docs):
https://github.com/xpl/ololog#timestamping
The locale
format option is now enabled by default (instead of ISO). You can also change it this way:
log = log.configure ({ time: { yes: true, format: 'iso' } })
Here is the correspondence between the format
option value and the related Date
method used for rendering:
format value |
Date method |
---|---|
"locale" |
.toLocaleString () |
"iso" |
.toISOString () |
"utc" |
.toUTCString () |
null |
.toString () |
@ourarash Hmm, it looks like the Travis CI deploy script is somehow got broken, as these changes are not deployed to NPM. I'll figure out the problem soon.
@ourarash It is finally available in NPM, sorry for the delay.
Currently when you set
date:true
, the date if printed in ISO format:2018-04-27T18:30:09.573Z
It would be great to show it in local value