first commit
This commit is contained in:
34
modules/colorfulLogger.js
Executable file
34
modules/colorfulLogger.js
Executable file
@@ -0,0 +1,34 @@
|
||||
const colors = {
|
||||
noformat: '\033[0m',
|
||||
Fbold: '\033[1m',
|
||||
Fgreen: '\x1b[32m',
|
||||
Fblue: '\x1b[34m',
|
||||
Fred: '\x1b[31m',
|
||||
Fwhite: '\x1b[37m',
|
||||
Cwhite: '\033[38;5;15m',
|
||||
Clime: '\033[48;5;10m',
|
||||
Cred: '\033[48;5;9m',
|
||||
Cyellow: '\033[48;5;3m',
|
||||
Cgreen: '\033[48;5;2m',
|
||||
Ccyan: '\033[48;5;6m',
|
||||
Corange: '\033[48;5;202m'
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
info(...args) {
|
||||
console.log(`${colors.Clime}${colors.Fwhite} INFO ${colors.noformat}`, ...args);
|
||||
},
|
||||
warn(...args) {
|
||||
console.log(`${colors.Cyellow}${colors.Fwhite} WARN ${colors.noformat}`, ...args);
|
||||
},
|
||||
error(...args) {
|
||||
console.error(`${colors.Cred}${colors.Fwhite} ERRO ${colors.noformat}`, ...args);
|
||||
},
|
||||
debug(...args) {
|
||||
console.log(`${colors.Corange}${colors.Fwhite} DEBG ${colors.noformat}`, ...args);
|
||||
},
|
||||
term(...args) {
|
||||
console.log(`${colors.Ccyan}${colors.Fwhite} TERM ${colors.noformat}`, ...args)
|
||||
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user