That is logger library from voicer, that library can do a visual log and write logs in a file.
Goodbye consoles, hello Logger !
First step is install the library you can use yarn
or npm
, follow the commands.
yarn add voicer-logger
or npm i --save voicer-logger
These library has own types, you doesnt need to install.
That library is very simple to use is only to import one method and let's use it.
import { Logger } from 'voicer-logger'
import { resolve } from 'path'
//with no writable log
const log = Logger()
//or use writable log
const log = Logger({
fileWithPath: resolve(__dirname,'foo.log')
})
That library works with log levels, 'info', 'warning' and 'error'.
Follow the example 🏃
...
log.info('thats info log')
log.warning('thats warning log')
log.error(new Error())
...
©️ all rights reserved from Voicer
🧑🚀 that library was made by Lucas Veloso