Rework padding option

This commit is contained in:
2024-05-22 10:14:20 +02:00
parent 140382073d
commit 7a4284ef6a
+1 -5
View File
@@ -54,7 +54,7 @@ function log(message: any[], level: Level, namespace: string) : void {
.replace("$namespace", namespace)
let lvl = get_string(level)
if (options.pad_level) lvl = pad(lvl)
if (!options.pad_level) lvl = lvl.trimEnd()
const head_color = head.replace('$level', get_color(level)(lvl))
const head_bw = head.replace('$level', lvl)
@@ -69,10 +69,6 @@ function log(message: any[], level: Level, namespace: string) : void {
}
}
function pad(str: string) : string {
return str + " ".repeat("WARNING".length - str.length)
}
function get_string(level: Level) : string {
switch (level) {
case Level.DEBUG: return "DEBUG "