Compare commits
1 Commits
bd9a99414c
...
5dea4a8bc5
Author | SHA1 | Date |
---|---|---|
Evan Chen | 5dea4a8bc5 |
23
log.go
23
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 {
|
||||
|
|
Loading…
Reference in New Issue