* Define and use an interface for logging. This allows alternative implementations to use whatever logging package they want. Currently the interface just mimicks what logrus already implements, with minor modifications to not rely on logrus itself. I think the interface is pretty solid in terms of logging implementations being able to do what they need to. * Make tracing interface to coalesce logging/tracing Allows us to share data between the tracer and the logger so we can simplify log/trace handling wher we generally want data to go both places.
17 lines
299 B
Go
17 lines
299 B
Go
package logrus
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/Sirupsen/logrus"
|
|
"github.com/virtual-kubelet/virtual-kubelet/log"
|
|
)
|
|
|
|
func TestImplementsLoggerInterface(t *testing.T) {
|
|
l := FromLogrus(&logrus.Entry{})
|
|
|
|
if _, ok := l.(log.Logger); !ok {
|
|
t.Fatal("does not implement log.Logger interface")
|
|
}
|
|
}
|