From aefe85028193fbc035f428bbd4cc3d8956e68b2b Mon Sep 17 00:00:00 2001 From: Admin Else <74665496+admin-else@users.noreply.github.com> Date: Sun, 29 Mar 2026 14:21:54 +0200 Subject: [PATCH] Fix send debug message --- proto/connection.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/proto/connection.go b/proto/connection.go index 52bc8a1..b9f0d23 100644 --- a/proto/connection.go +++ b/proto/connection.go @@ -193,7 +193,11 @@ func (c *Conn) sendRegisteredPacket(packet proto_base.EncodeDecodeAble) (err err if err != nil { return } - slog.Debug("send", "actor", c.Actor, "packet", fmt.Sprintf("%#v", packet)) + debugPrint := slog.Default().Enabled(context.Background(), slog.LevelDebug) && + slices.ContainsFunc(c.DebugPrintPackets, func(s string) bool { return strings.Contains(i.Name, s) }) + if debugPrint { + slog.Debug("send", "actor", c.Actor, "packet", fmt.Sprintf("%#v", packet)) + } return c.SendRaw(packetBuff.Bytes()) }