Commit a8736c1e authored by Nong Hoang Tu's avatar Nong Hoang Tu
Browse files

Update color for log. Different from infor and success

parent a758fdd6
Pipeline #3299 failed with stages
in 0 seconds
...@@ -99,7 +99,8 @@ proc updateProjectAll(config: ProgConf) = ...@@ -99,7 +99,8 @@ proc updateProjectAll(config: ProgConf) =
if updateResult == Err.updated: if updateResult == Err.updated:
resultLog.logInfo(project.name, "Up to date") resultLog.logInfo(project.name, "Up to date")
elif updateResult == Err.updateSuccess: elif updateResult == Err.updateSuccess:
resultLog.logInfo(project.name, "Update successfully") # resultLog.logInfo(project.name, "Update successfully")
resultLog.logUpdated(project.name)
else: else:
resultLog.logErr(project.name, "Failed to update", "") resultLog.logErr(project.name, "Failed to update", "")
...@@ -121,7 +122,8 @@ proc updateProjectArr(config: ProgConf, projectArr: seq[string]) = ...@@ -121,7 +122,8 @@ proc updateProjectArr(config: ProgConf, projectArr: seq[string]) =
if updateResult == Err.updated: if updateResult == Err.updated:
resultLog.logInfo(project.name, "Up to date") resultLog.logInfo(project.name, "Up to date")
elif updateResult == Err.updateSuccess: elif updateResult == Err.updateSuccess:
resultLog.logInfo(project.name, "Update successfully") resultLog.logUpdated(project.name)
# resultLog.logInfo(project.name, "Update successfully")
else: else:
resultLog.logErr(project.name, "Failed to update", "") resultLog.logErr(project.name, "Failed to update", "")
......
...@@ -51,13 +51,20 @@ proc logInfo*(handler: LogHandler, prjName, msg: string) = ...@@ -51,13 +51,20 @@ proc logInfo*(handler: LogHandler, prjName, msg: string) =
proc logErr*(handler: LogHandler, prjName, msg, stderr: string) = proc logErr*(handler: LogHandler, prjName, msg, stderr: string) =
# bright magenta # bright magenta
let fullMsg = "\e[95m[" & prjName & "] " & msg & "\e[0m" let fullMsg = "\e[97m[" & prjName & "] " & msg & "\e[0m"
handler.print.log(lvlError, fullMsg) handler.print.log(lvlError, fullMsg)
handler.save.log(lvlError, fullMsg) handler.save.log(lvlError, fullMsg)
if stdErr != "": if stdErr != "":
handler.save.log(lvlError, "\n" & stderr) handler.save.log(lvlError, "\n" & stderr)
proc logUpdated*(handler: LogHandler, prjName: string) =
# bright magenta
let fullMsg = "\e[95m[" & prjName & "] Updated successfully\e[0m"
handler.print.log(lvlError, fullMsg)
handler.save.log(lvlError, fullMsg)
proc logDebug*(handler: LogHandler, prjName, msg: string) = proc logDebug*(handler: LogHandler, prjName, msg: string) =
let fullMsg = "[" & prjName & "] " & msg let fullMsg = "[" & prjName & "] " & msg
handler.print.log(lvlDebug, fullMsg) handler.print.log(lvlDebug, fullMsg)
......
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