forked from Senither/hypixel-discord-chat-bridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLogger.js
33 lines (25 loc) · 1.04 KB
/
Logger.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const chalk = require('chalk')
class Logger {
discord(message) {
return console.log(chalk.bgMagenta.black(`[${this.getCurrentTime()}] Discord >`) + ' ' + chalk.magenta(message))
}
minecraft(message) {
return console.log(chalk.bgGreenBright.black(`[${this.getCurrentTime()}] Minecraft >`) + ' ' + chalk.greenBright(message))
}
express(message) {
return console.log(chalk.bgCyan.black(`[${this.getCurrentTime()}] Express >`) + ' ' + chalk.cyan(message))
}
warn(message) {
return console.log(chalk.bgYellow.black(`[${this.getCurrentTime()}] Warning >`) + ' ' + chalk.yellow(message))
}
error(message) {
return console.log(chalk.bgRedBright.black(`[${this.getCurrentTime()}] Error >`) + ' ' + chalk.redBright(message))
}
broadcast(message, location) {
return console.log(chalk.inverse(`[${this.getCurrentTime()}] ${location} Broadcast >`) + ' ' + message)
}
getCurrentTime() {
return new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', hour12: false })
}
}
module.exports = Logger