func TestNull(t *testing.T) { log.SetNull() log.SetLevel(-1000) if log.IsTrace() { t.Error("There should be no trace") } if log.IsDebug() { t.Error("There should be no debug") } if log.IsInfo() { t.Error("There should be no info") } if log.IsWarn() { t.Error("There should be no warn") } var args []interface{} args = append(args, "key1", 1, "key2", 3.14152) log.Trace("Hello World", args...) log.Debug("Hello World", args...) log.Info("Hello World", args...) log.Warn("Hello World", args...) log.Error("Hello World", args...) log.Log(1, "Hello World", args) }
func TestNull(t *testing.T) { log.SetLevel(-1000) if !log.IsDebug() { t.Error("There should be debug logging") } if !log.IsInfo() { t.Error("There should be info logging") } var args []interface{} args = append(args, "key1", 1, "key2", 3.14152) log.Debug("Hello World", args...) log.Info("Hello World", args...) }
func init() { log.Set(log.NewStdLogger()) log.SetLevel(log.StdLevelDebug) }
func init() { log.Set(log.NewStdLogger( log.SetStdError(&errLogBuf, "testErr: ", std.Lshortfile), )) log.SetLevel(log.StdLevelError) }
func init() { log.Set(log.NewStdLogger()) log.SetLevel(log.StdLevelError) }
func init() { log.SetLevel(log.StdLevelInfo) }