github.com/cayleygraph/cayley@v0.7.7/clog/glog/glog.go (about)

     1  package glog
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/cayleygraph/cayley/clog"
     7  	"github.com/golang/glog"
     8  )
     9  
    10  func init() {
    11  	clog.SetLogger(Logger{})
    12  }
    13  
    14  type Logger struct{}
    15  
    16  func (Logger) Infof(format string, args ...interface{}) {
    17  	glog.InfoDepth(3, fmt.Sprintf(format, args...))
    18  }
    19  func (Logger) Warningf(format string, args ...interface{}) {
    20  	glog.WarningDepth(3, fmt.Sprintf(format, args...))
    21  }
    22  func (Logger) Errorf(format string, args ...interface{}) {
    23  	glog.ErrorDepth(3, fmt.Sprintf(format, args...))
    24  }
    25  func (Logger) Fatalf(format string, args ...interface{}) {
    26  	glog.FatalDepth(3, fmt.Sprintf(format, args...))
    27  }
    28  
    29  func (Logger) V(level int) bool {
    30  	return bool(glog.V(glog.Level(level)))
    31  }
    32  
    33  func (Logger) SetV(v int) {
    34  	glog.Warningf("changing log level is not supported; run command with '-v %d' flag", v)
    35  }