fancy-format-log
v3.0.0
Published
Log things, prefixed with a customized format timestamp
Maintainers
Readme
fancy-format-log
Log things, prefixed with a customized format timestamp

Install
$ npm install fancy-format-logUsage
const format = require('fancy-format-log')
const options = {
format: 'YYYY-MM-DD HH:mm:ss:ms', // Optional - Default is 'HH:mm:ss'
style: 'dim.green' // Optional - Default is 'grey'
}
const f = format(options)
f.log('a message')
f.error('oh no!')Valid patterns
YYYY: full yearMM: monthDD: dayHH: hoursmm: minutesss: secondsms: milliseconds
Valid styles
See chalk-pipe valid styles.
Example
Here is example.
API
f.log(msg...)
Logs the message as if you called console.log but prefixes the output with the current time.
f.error(msg...)
Logs the message as if you called console.error but prefixes the output with the current time.
f.warn(msg...)
Logs the message as if you called console.warn but prefixes the output with the current time.
f.info(msg...)
Logs the message as if you called console.info but prefixes the output with the current time.
f.dir(msg...)
Logs the message as if you called console.dir but prefixes the output with the current time.
Related
- chalk-pipe - Create chalk style schemes with simpler style strings
- fancy-log - Log things, prefixed with a timestamp
License
MIT © LitoMore
