Rework padding option
This commit is contained in:
+1
-5
@@ -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 "
|
||||
|
||||
Reference in New Issue
Block a user