diff --git a/internal/lg/lg_test.go b/internal/lg/lg_test.go index 5458c2860..537dcace5 100644 --- a/internal/lg/lg_test.go +++ b/internal/lg/lg_test.go @@ -99,3 +99,11 @@ func TestLogging(t *testing.T) { } test.Equal(t, 5, logger.Count) } + +func TestNoLogger(t *testing.T) { + opts := newOptions() + opts.Logger = NilLogger{} + app := newApp(opts) + + app.logf(ERROR, "should never be logged") +} diff --git a/nsqadmin/nsqadmin_test.go b/nsqadmin/nsqadmin_test.go index 2f0830565..c9651ca83 100644 --- a/nsqadmin/nsqadmin_test.go +++ b/nsqadmin/nsqadmin_test.go @@ -15,16 +15,6 @@ import ( "github.com/nsqio/nsq/nsqd" ) -func TestNoLogger(t *testing.T) { - opts := NewOptions() - opts.Logger = lg.NilLogger{} - opts.HTTPAddress = "127.0.0.1:0" - opts.NSQLookupdHTTPAddresses = []string{"127.0.0.1:4161"} - nsqadmin := New(opts) - - nsqadmin.logf(LOG_ERROR, "should never be logged") -} - func TestNeitherNSQDAndNSQLookup(t *testing.T) { if os.Getenv("BE_CRASHER") == "1" { opts := NewOptions() diff --git a/nsqlookupd/nsqlookupd_test.go b/nsqlookupd/nsqlookupd_test.go index cccb4790b..54770574b 100644 --- a/nsqlookupd/nsqlookupd_test.go +++ b/nsqlookupd/nsqlookupd_test.go @@ -68,16 +68,6 @@ func identify(t *testing.T, conn net.Conn) { test.Nil(t, err) } -func TestNoLogger(t *testing.T) { - opts := NewOptions() - opts.Logger = lg.NilLogger{} - opts.TCPAddress = "127.0.0.1:0" - opts.HTTPAddress = "127.0.0.1:0" - nsqlookupd := New(opts) - - nsqlookupd.logf(LOG_FATAL, "should never be logged") -} - func TestBasicLookupd(t *testing.T) { opts := NewOptions() opts.Logger = test.NewTestLogger(t)