fix blockpool test logger

This commit is contained in:
zelig 2015-03-22 02:18:07 +00:00
parent 78cff9e3a4
commit 0edb33566f

View File

@ -21,8 +21,7 @@ func TestFunc(t *testing.T) {
*/ */
func LogInit() { func LogInit() {
once.Do(func() { once.Do(func() {
var logsys = logger.NewStdLogSystem(os.Stdout, log.LstdFlags, logger.LogLevel(logger.WarnLevel)) logger.NewStdLogSystem(os.Stdout, log.LstdFlags, logger.LogLevel(logger.DebugDetailLevel))
logger.AddLogSystem(logsys)
}) })
} }
@ -41,11 +40,8 @@ func Testlog(t *testing.T) testLogger {
return l return l
} }
func (testLogger) GetLogLevel() logger.LogLevel { return logger.DebugLevel } func (l testLogger) LogPrint(msg logger.LogMsg) {
func (testLogger) SetLogLevel(logger.LogLevel) {} l.t.Log(msg.String())
func (l testLogger) LogPrint(level logger.LogLevel, msg string) {
l.t.Logf("%s", msg)
} }
func (testLogger) Detach() { func (testLogger) Detach() {
@ -68,12 +64,10 @@ func Benchlog(b *testing.B) benchLogger {
return l return l
} }
func (benchLogger) GetLogLevel() logger.LogLevel { return logger.Silence } func (l benchLogger) LogPrint(msg logger.LogMsg) {
l.b.Log(msg.String())
func (benchLogger) SetLogLevel(logger.LogLevel) {}
func (l benchLogger) LogPrint(level logger.LogLevel, msg string) {
l.b.Logf("%s", msg)
} }
func (benchLogger) Detach() { func (benchLogger) Detach() {
logger.Flush() logger.Flush()
logger.Reset() logger.Reset()