Logging tweaks
This commit is contained in:
parent
83d77f8865
commit
361d3ebbcb
|
@ -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()
|
||||
|
||||
|
|
|
@ -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.} =
|
||||
|
|
Loading…
Reference in New Issue