github.com/ethereum/go-ethereum@v1.16.1/log/root_test.go (about)

     1  package log
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  // SetDefault should properly set the default logger when custom loggers are
     8  // provided.
     9  func TestSetDefaultCustomLogger(t *testing.T) {
    10  	type customLogger struct {
    11  		Logger // Implement the Logger interface
    12  	}
    13  
    14  	customLog := &customLogger{}
    15  	SetDefault(customLog)
    16  	if Root() != customLog {
    17  		t.Error("expected custom logger to be set as default")
    18  	}
    19  }