Added logging to pools and workers.
This commit is contained in:
@@ -233,7 +233,7 @@ func (c *Connection) shutdownSignalDone() {
|
||||
|
||||
func (c *Connection) shutdownLogStart() {
|
||||
if c.logger != nil {
|
||||
c.logger.Info("shutting down")
|
||||
c.logger.Info("closing")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ func (c *Connection) shutdownCloseChannels() {
|
||||
|
||||
func (c *Connection) shutdownLogComplete() {
|
||||
if c.logger != nil {
|
||||
c.logger.Info("connection closed")
|
||||
c.logger.Info("closed")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -161,14 +161,14 @@ func TestCloseLogging(t *testing.T) {
|
||||
|
||||
honeybeetest.Eventually(t, func() bool {
|
||||
return honeybeetest.FindLogRecord(
|
||||
mockHandler.GetRecords(), slog.LevelInfo, "connection closed") != nil
|
||||
mockHandler.GetRecords(), slog.LevelInfo, "closed") != nil
|
||||
}, "expected log")
|
||||
|
||||
records := mockHandler.GetRecords()
|
||||
|
||||
expected := []honeybeetest.ExpectedLog{
|
||||
log(slog.LevelInfo, "shutting down", map[string]any{}),
|
||||
log(slog.LevelInfo, "connection closed", map[string]any{}),
|
||||
log(slog.LevelInfo, "closing", map[string]any{}),
|
||||
log(slog.LevelInfo, "closed", map[string]any{}),
|
||||
}
|
||||
|
||||
honeybeetest.AssertLogSequence(t, records, expected)
|
||||
@@ -197,7 +197,7 @@ func TestCloseLogging(t *testing.T) {
|
||||
records := mockHandler.GetRecords()
|
||||
|
||||
expected := []honeybeetest.ExpectedLog{
|
||||
log(slog.LevelInfo, "shutting down", map[string]any{}),
|
||||
log(slog.LevelInfo, "closing", map[string]any{}),
|
||||
log(slog.LevelError, "socket close failed", map[string]any{"error": closeErr}),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user