levels: add to logger type

This commit is contained in:
Simon Eskildsen
2014-03-10 19:52:39 -04:00
parent d3ee06cc28
commit afde6aea11
5 changed files with 36 additions and 43 deletions
+3 -1
View File
@@ -10,6 +10,7 @@ type Logger struct {
Out io.Writer
Hooks levelHooks
Formatter Formatter
Level Level
mu sync.Mutex
}
@@ -18,6 +19,7 @@ func New() *Logger {
Out: os.Stdout, // Default to stdout, change it if you want.
Formatter: new(TextFormatter),
Hooks: make(levelHooks),
Level: Info,
}
}
@@ -74,7 +76,7 @@ func (logger *Logger) Info(args ...interface{}) {
}
func (logger *Logger) Print(args ...interface{}) {
NewEntry(logger).Print(args...)
NewEntry(logger).Info(args...)
}
func (logger *Logger) Warn(args ...interface{}) {