|
@ -27,8 +27,6 @@ func listenReadAndClose(t *testing.T, l net.Listener, expected string) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func TestConnLogger(t *testing.T) { |
|
|
func TestConnLogger(t *testing.T) { |
|
|
var written []byte |
|
|
|
|
|
|
|
|
|
|
|
protocol := "tcp" |
|
|
protocol := "tcp" |
|
|
address := ":3099" |
|
|
address := ":3099" |
|
|
|
|
|
|
|
@ -79,8 +77,6 @@ func TestConnLogger(t *testing.T) { |
|
|
}() |
|
|
}() |
|
|
wg.Wait() |
|
|
wg.Wait() |
|
|
|
|
|
|
|
|
written = written[:0] |
|
|
|
|
|
|
|
|
|
|
|
event.level = WARN |
|
|
event.level = WARN |
|
|
expected = fmt.Sprintf("%s%s %s:%d:%s [%c] %s\n", prefix, dateString, event.filename, event.line, event.caller, strings.ToUpper(event.level.String())[0], event.msg) |
|
|
expected = fmt.Sprintf("%s%s %s:%d:%s [%c] %s\n", prefix, dateString, event.filename, event.line, event.caller, strings.ToUpper(event.level.String())[0], event.msg) |
|
|
wg.Add(2) |
|
|
wg.Add(2) |
|
@ -156,8 +152,6 @@ func TestConnLoggerFailConnect(t *testing.T) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func TestConnLoggerClose(t *testing.T) { |
|
|
func TestConnLoggerClose(t *testing.T) { |
|
|
var written []byte |
|
|
|
|
|
|
|
|
|
|
|
protocol := "tcp" |
|
|
protocol := "tcp" |
|
|
address := ":3099" |
|
|
address := ":3099" |
|
|
|
|
|
|
|
@ -217,8 +211,6 @@ func TestConnLoggerClose(t *testing.T) { |
|
|
assert.Equal(t, level, connLogger.Level) |
|
|
assert.Equal(t, level, connLogger.Level) |
|
|
assert.Equal(t, level, logger.GetLevel()) |
|
|
assert.Equal(t, level, logger.GetLevel()) |
|
|
|
|
|
|
|
|
written = written[:0] |
|
|
|
|
|
|
|
|
|
|
|
event.level = WARN |
|
|
event.level = WARN |
|
|
expected = fmt.Sprintf("%s%s %s:%d:%s [%c] %s\n", prefix, dateString, event.filename, event.line, event.caller, strings.ToUpper(event.level.String())[0], event.msg) |
|
|
expected = fmt.Sprintf("%s%s %s:%d:%s [%c] %s\n", prefix, dateString, event.filename, event.line, event.caller, strings.ToUpper(event.level.String())[0], event.msg) |
|
|
wg.Add(2) |
|
|
wg.Add(2) |
|
|