Commit 6172b8eb authored by Nong Hoang Tu's avatar Nong Hoang Tu
Browse files

add color to log

parent 019500cc
......@@ -33,13 +33,15 @@ proc initFullLogs*(path: string): LogHandler =
return initLogs(fullPath)
proc logInfo*(handler: LogHandler, msg: string) =
proc logInfo*(handler: LogHandler, prjName, msg: string) =
# bright cyan
handler.print.log(lvlInfo, "\e[96m" & msg & "\e[0m")
handler.save.log(lvlInfo, "\e[96m" & msg & "\e[0m")
let fullMsg = "[" & prjName & "] Update success"
handler.print.log(lvlInfo, "\e[96m" & fullMsg & "\e[0m")
handler.save.log(lvlInfo, "\e[96m" & fullMsg & "\e[0m")
proc logErr*(handler: LogHandler, msg: string) =
proc logErr*(handler: LogHandler, prjName, msg: string) =
# bright magenta
handler.print.log(lvlError, "\e[95m" & msg & "\e[0m")
handler.save.log(lvlError, "\e[95m" & msg & "\e[0m")
let fullMsg = "[" & prjName & "] Update success"
handler.print.log(lvlError, "\e[95m" & fullMsg & "\e[0m")
handler.save.log(lvlError, "\e[95m" & fullMsg & "\e[0m")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment