diff --git a/formatter.go b/formatter.go index d6888fb..ded3c5d 100644 --- a/formatter.go +++ b/formatter.go @@ -1,15 +1,11 @@ package log -import ( - "fmt" - "time" -) - // Formatter is a interface used to implement a custom Formatter type Formatter interface { Format(level Level, msg string, logger *Logger) []byte } +/* // simpleFormatter is default formmatter type simpleFormatter struct { } @@ -19,3 +15,4 @@ func (f *simpleFormatter) Format(level Level, msg string, logger *Logger) []byte time := time.Now().Format("15:04:05.000") return []byte(fmt.Sprintf("%s %s %s\n", time, level.String(), msg)) } +*/ diff --git a/logger.go b/logger.go index 11efda4..a794bcd 100644 --- a/logger.go +++ b/logger.go @@ -21,9 +21,11 @@ type Logger struct { // New creates a new Logger func New() *Logger { return &Logger{ - Level: INFO, - Formatter: new(simpleFormatter), - Out: os.Stdout, + Level: INFO, + Formatter: &TextFormatter{ + TimeFormat: "2006-01-02 15:04:05.000", + }, + Out: os.Stdout, } }