Compare commits
1 Commits
bd9a99414c
...
5dea4a8bc5
Author | SHA1 | Date |
---|---|---|
Evan Chen | 5dea4a8bc5 |
21
log.go
21
log.go
|
@ -97,15 +97,18 @@ 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" },
|
||||
// "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 {
|
||||
|
|
Loading…
Reference in New Issue