From 361d3ebbcb20fc937e606c6e5d957ad61c51ac2f Mon Sep 17 00:00:00 2001 From: Quad Date: Wed, 13 Apr 2022 22:34:26 +0200 Subject: [PATCH] Logging tweaks --- src/modules/formatter.nim | 3 ++- src/modules/views.nim | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/formatter.nim b/src/modules/formatter.nim index d556fba..4345c05 100644 --- a/src/modules/formatter.nim +++ b/src/modules/formatter.nim @@ -20,7 +20,7 @@ proc colorEsc(color: string): string {.gcsafe.} = proc colorize(text: string, color: string): string {.gcsafe.} = return colorEsc(color) & text & colorEsc("reset") -proc strCenter(text: string, filler: string = "-", length: int = 10): string {.gcsafe.} = +proc strCenter(text: string, filler: string = "-", length: int = 8): string {.gcsafe.} = # Simply truncate and return if it fills the entire length if text.len() > length: return text[0..length-1] @@ -39,6 +39,7 @@ proc logFormat(text: string, level: string = "undef"): string {.gcsafe.} = "Error": "red", "Info": "purple", "Warning": "orange", + "Web": "blue", "undef": "cyan" }.toTable() diff --git a/src/modules/views.nim b/src/modules/views.nim index ffc508c..249d7e8 100644 --- a/src/modules/views.nim +++ b/src/modules/views.nim @@ -3,7 +3,7 @@ import nimja/parser import formatter proc renderTemplate(templateName: static[string]): string = - logPrint("Served template " & templateName, "Main") + logPrint("Served template " & templateName, "Web") compileTemplateFile(getScriptDir() & "/templates/" & templateName) proc getIndex*(ctx: Context) {.async.} =