From 5dea4a8bc52f9c609e07df9629ff22f970c5ba27 Mon Sep 17 00:00:00 2001 From: Evan Chen Date: Mon, 1 Nov 2021 22:41:11 +0800 Subject: [PATCH] update --- log.go | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/log.go b/log.go index 47ea0a9..3e99c98 100644 --- a/log.go +++ b/log.go @@ -96,16 +96,19 @@ func NewLogFormater() *LogFormater { func (l *logger) SetTmpl(tmpl *LogFormater) error { funcMap := template.FuncMap{ - "Time": func() string { return time.Now().Format("2006/01/02 15:04:05") }, - "red": func() string { return "\033[91m" }, - "redl": func() string { return "\033[31m" }, - "green": func() string { return "\033[92m" }, - "yellow": func() string { return "\033[93m" }, - "blue": func() string { return "\033[94m" }, - "magenta": func() string { return "\033[95m" }, - "cyan": func() string { return "\033[96m" }, - "white": func() string { return "\033[97m" }, - "reset": func() string { return "\033[0m" }, + "Time": func() string { return time.Now().Format("2006/01/02 15:04:05") }, + // "red": func() string { return "\033[91m" }, + // "redl": func() string { return "\033[31m" }, + // "green": func() string { return "\033[92m" }, + // "yellow": func() string { return "\033[93m" }, + // "blue": func() string { return "\033[94m" }, + // "magenta": func() string { return "\033[95m" }, + // "cyan": func() string { return "\033[96m" }, + // "white": func() string { return "\033[97m" }, + // "reset": func() string { return "\033[0m" }, + } + if l.color { + } err_tmpl, err := template.New("err_tmpl").Funcs(funcMap).Parse(tmpl.ErrTmplStr) if err != nil {