2
0

Reduce Logger interface to Log method

This commit is contained in:
Jack Christensen
2016-08-02 14:42:31 -05:00
parent 04c02cf3d3
commit 390f75c0e1
7 changed files with 36 additions and 98 deletions
+2 -9
View File
@@ -7,8 +7,7 @@ import (
)
// The values for log levels are chosen such that the zero value means that no
// log level was specified and we can default to LogLevelDebug to preserve
// the behavior that existed prior to log level introduction.
// log level was specified.
const (
LogLevelTrace = 6
LogLevelDebug = 5
@@ -19,15 +18,9 @@ const (
)
// Logger is the interface used to get logging from pgx internals.
// https://github.com/inconshreveable/log15 is the recommended logging package.
// This logging interface was extracted from there. However, it should be simple
// to adapt any logger to this interface.
type Logger interface {
// Log a message at the given level with context key/value pairs
Debug(msg string, ctx ...interface{})
Info(msg string, ctx ...interface{})
Warn(msg string, ctx ...interface{})
Error(msg string, ctx ...interface{})
Log(level int, msg string, ctx ...interface{})
}
// LogLevelFromString converts log level string to constant