fix format
This commit is contained in:
parent
c4bf07cd98
commit
d50d4e7f1b
11
console.go
11
console.go
|
@ -1,6 +1,9 @@
|
||||||
package gologger
|
package gologger
|
||||||
|
|
||||||
import "fmt"
|
import (
|
||||||
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ErrorTemplate = "\033[1;31;40m%s\033[0m\n"
|
ErrorTemplate = "\033[1;31;40m%s\033[0m\n"
|
||||||
|
@ -19,8 +22,12 @@ func (c *ConsoleAppender) GetName() string {
|
||||||
func (c *ConsoleAppender) Append(logEvent LogEvent) {
|
func (c *ConsoleAppender) Append(logEvent LogEvent) {
|
||||||
data := []interface{}{
|
data := []interface{}{
|
||||||
logEvent.Ts.Format("2006-01-02 15:04:05"),
|
logEvent.Ts.Format("2006-01-02 15:04:05"),
|
||||||
|
" ",
|
||||||
}
|
}
|
||||||
data = append(data, logEvent.Data...)
|
dmsg := fmt.Sprint(logEvent.Data)
|
||||||
|
dmsg = strings.TrimLeft(dmsg, "[")
|
||||||
|
dmsg = strings.TrimRight(dmsg, "]")
|
||||||
|
data = append(data, dmsg)
|
||||||
logMsg := fmt.Sprint(data...)
|
logMsg := fmt.Sprint(data...)
|
||||||
switch logEvent.Level {
|
switch logEvent.Level {
|
||||||
case Error:
|
case Error:
|
||||||
|
|
Loading…
Reference in New Issue