Add guard against unknown level

This commit is contained in:
Ben Hardill
2025-04-16 12:40:35 +01:00
parent 082afb7ebd
commit 93c55e3a1e

View File

@@ -99,7 +99,7 @@ const utilLog = function (msg, level) {
d.getMinutes().toString().padStart(2, '0'),
d.getSeconds().toString().padStart(2, '0')
].join(':');
console.log(chalk[levelColours[level]](`${d.getDate()} ${months[d.getMonth()]} ${time} - ${msg}`))
console.log(chalk[levelColours[level] || 'white'](`${d.getDate()} ${months[d.getMonth()]} ${time} - ${msg}`))
}
var consoleLogger = function(msg) {