dbcustomlog
v1.4.0
Published
Custom Logging for my discord bot
Downloads
6
Maintainers
Readme
Installation
Install the package usingnpm i dbcustomlog
To add it as a dependency, useyarn add dbcustomlog
or npm i -S dbcustomlog
Once installed, require the package with
const logger = require('dbcustomlog')
const log = new logger()
Usage
Call one of the following functions or shortcuts for different levels of warning.
i or info
s or success
e or error
c or command
w or warn
Example Call
log.i(msg)
// Where msg is the message you want to log
File Output
To output to a file, pass the file path as an argument when creating the new class
// Example
const path = require('path')
const log = new logger(path.join(__dirname, 'default.log'))
Examples
// Info
log.i("Log Message")
// Debug
log.s("Log Message")
// Error
log.e("Log Message")
// Verbose
log.c("Log Message")
// Warn
log.w("Log Message")
Would Output
[INFO] [01/01/1970 00:00:00] Log Message
[SUCCESS] [01/01/1970 00:00:00] Log Message
[ERROR] [01/01/1970 00:00:00] Log Message
[COMMAND] [01/01/1970 00:00:00] Log Message
[WARN] [01/01/1970 00:00:00] Log Message