$ npm install rhyno --save
import { Logger, Level, Transport } from 'rhyno'
const logger = new Logger({
transports: [
new Transport({
level: new Level({
name: 'test',
color: 'CYAN',
format: '{{color}}[ {{prefix}} ] {{reset_color}}({{time}}) {{message}}',
time: {
format: 'DD/MM/YYYY HH:mm:ss',
locale: 'es'
}
})
})
]
})
logger.log({
level: 'test',
message: 'Hi, this is a test using Rhyno!'
})
The output will be:
[ test ] (19/02/2021 19:32) Hi, this a test using Rhyno!
Any format is allowed:
[ test ] (20/03/2022 15:23) Hi, this a test using Rhyno!
You can also log without date (first delete the placeholder on format):
[ test ] Hi, this a test using Rhyno!