type Logger interface {
Error(err error)
Debugf(format string, args ...interface{})
Noticef(format string, args ...interface{})
}
Ideal to use with Kubernates where you usually write logs to stdout and stderr.
method Error
will write to stderr and methods Debugf
and Noticef
will write
to stdout. Debugf
writes only in glog.Dev
environment and Error
and Noticef
both
in glog.Dev
and glog.Prod
.
lg := glog.NewStdoutLogger(glog.Dev, "my-service")
lg.Error(errors.New("some error"))
lg.Debugf("Something to debug %s", "foo")
lg.Noticef("Something to debug %s", "foo")
lg := glog.NullLogger{}
// nothing will be written
lg.Error(errors.New("some error"))
lg.Debugf("Something to debug %s", "foo")
lg.Noticef("Something to debug %s", "foo")