This commit is contained in:
2016-10-14 23:35:07 +01:00
parent 62eaba8408
commit 8a5cfde134
197 changed files with 236240 additions and 0 deletions

32
vendor/github.com/fluffle/goirc/logging/glog/glog.go generated vendored Normal file
View File

@@ -0,0 +1,32 @@
package glog
import (
"fmt"
"github.com/golang/glog"
"github.com/fluffle/goirc/logging"
)
// Simple adapter to utilise Google's GLog package with goirc.
// Just import this package alongside goirc/client and call
// glog.Init() in your main() to set things up.
type GLogger struct{}
func (gl GLogger) Debug(f string, a ...interface{}) {
// GLog doesn't have a "Debug" level, so use V(2) instead.
if glog.V(2) {
glog.InfoDepth(3, fmt.Sprintf(f, a...))
}
}
func (gl GLogger) Info(f string, a ...interface{}) {
glog.InfoDepth(3, fmt.Sprintf(f, a...))
}
func (gl GLogger) Warn(f string, a ...interface{}) {
glog.WarningDepth(3, fmt.Sprintf(f, a...))
}
func (gl GLogger) Error(f string, a ...interface{}) {
glog.ErrorDepth(3, fmt.Sprintf(f, a...))
}
func Init() {
logging.SetLogger(GLogger{})
}