Skip to content

Commit

Permalink
by default forward the logs to the standard logger
Browse files Browse the repository at this point in the history
  • Loading branch information
vrischmann committed Nov 22, 2016
1 parent 9a96eb7 commit 55a0619
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions logger.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
package gocql

import (
"io/ioutil"
"log"
)
import "log"

type StdLogger interface {
Print(v ...interface{})
Printf(format string, v ...interface{})
Println(v ...interface{})
}

var Logger StdLogger = log.New(ioutil.Discard, "", log.LstdFlags)
type defaultLogger struct{}

func (l *defaultLogger) Print(v ...interface{}) { log.Print(v...) }
func (l *defaultLogger) Printf(format string, v ...interface{}) { log.Printf(format, v...) }
func (l *defaultLogger) Println(v ...interface{}) { log.Println(v...) }

var Logger StdLogger = &defaultLogger{}

0 comments on commit 55a0619

Please sign in to comment.