Remove global logger

gnatsd currently uses a global logger. This can cause some problems
(especially around the config-reload work), but global variables are
also just an anti-pattern in general. The current behavior is
particularly surprising because the global logger is configured through
calls to the Server.

This addresses issue #500 by removing the global logger and making it a
field on Server.
This commit is contained in:
Tyler Treat
2017-05-31 16:06:31 -05:00
parent d6069447d2
commit 28160f1de2
11 changed files with 119 additions and 118 deletions

View File

@@ -288,7 +288,8 @@ func TestSplitConnectArg(t *testing.T) {
}
func TestSplitDanglingArgBuf(t *testing.T) {
c := &client{subs: make(map[string]*subscription)}
s := New(&defaultServerOptions)
c := &client{srv: s, subs: make(map[string]*subscription)}
// We test to make sure we do not dangle any argBufs after processing
// since that could lead to performance issues.