Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func SetStderrLevel ¶
func SetStderrLevel(level StderrLevel)
Types ¶
type GlogWriter ¶
type GlogWriter struct{}
GlogWriter serves as a bridge between the standard log package and the glog package.
type StderrLevel ¶
type StderrLevel int32
const ( StderrLevelInfo StderrLevel = iota StderrLevelWarning StderrLevelError StderrLevelNothing )
type Wrapper ¶
type Wrapper struct { Handler WrapFunc // contains filtered or unexported fields }
Wrapper use WrapFunc to handle the log message before send it to glog. Can be use as:
var handler blog.WrapFunc = func(format string, args ...interface{}) string { src := fmt.Sprintf(format, args...) dst := regexp.MustCompile("boy").ReplaceAllString(src, "man") } blog.Wrapper(handler).V(2).Info("hello boy")
And it will flush as:
I0104 09:44:27.796409 16233 blog.go:21] hello man
Click to show internal directories.
Click to hide internal directories.