From 92e2aa987ea358858d08579a68e9b106e476824d Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Wed, 15 Jan 2025 22:12:40 -0500 Subject: [PATCH 1/4] move debug log ID within NS CLIENTS LIST output --- irc/nickserv.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/irc/nickserv.go b/irc/nickserv.go index 9a776d06..8adb0c08 100644 --- a/irc/nickserv.go +++ b/irc/nickserv.go @@ -1324,6 +1324,9 @@ func nsClientsListHandler(service *ircService, server *Server, client *Client, p if session.deviceID != "" { service.Notice(rb, fmt.Sprintf(client.t("Device ID: %s"), session.deviceID)) } + if hasPrivs { + service.Notice(rb, fmt.Sprintf(client.t("Debug log ID: %s"), session.connID)) + } service.Notice(rb, fmt.Sprintf(client.t("IP address: %s"), session.ip.String())) service.Notice(rb, fmt.Sprintf(client.t("Hostname: %s"), session.hostname)) if hasPrivs { @@ -1339,9 +1342,6 @@ func nsClientsListHandler(service *ircService, server *Server, client *Client, p service.Notice(rb, fmt.Sprintf(client.t("IRCv3 CAPs: %s"), capStr)) } } - if hasPrivs { - service.Notice(rb, fmt.Sprintf(client.t("Debug log ID: %s"), session.connID)) - } } } From e520ba7e0e4c14b01a5f6ba4ba2229dfe27728fe Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Wed, 15 Jan 2025 22:12:40 -0500 Subject: [PATCH 2/4] list push subscription times as well --- irc/nickserv.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/irc/nickserv.go b/irc/nickserv.go index 8adb0c08..3e4637f4 100644 --- a/irc/nickserv.go +++ b/irc/nickserv.go @@ -1686,7 +1686,10 @@ func nsPushHandler(service *ircService, server *Server, client *Client, command subscriptions := target.getPushSubscriptions() service.Notice(rb, fmt.Sprintf(client.t("Nickname %[1]s has %[2]d push subscription(s)"), target.Nick(), len(subscriptions))) for i, subscription := range subscriptions { - service.Notice(rb, fmt.Sprintf("%d: %s", i, subscription.Endpoint)) + service.Notice(rb, fmt.Sprintf(client.t("Subscription %d:"), i+1)) + service.Notice(rb, fmt.Sprintf(client.t("Endpoint: %s"), subscription.Endpoint)) + service.Notice(rb, fmt.Sprintf(client.t("Last renewal: %s"), subscription.LastRefresh.Format(time.RFC1123))) + service.Notice(rb, fmt.Sprintf(client.t("Last push: %s"), subscription.LastSuccess.Format(time.RFC1123))) } case "DELETE": if len(params) < 2 { From 2163d9634881f699ea2fc508800fcd4c19fba7ff Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Wed, 15 Jan 2025 22:12:40 -0500 Subject: [PATCH 3/4] add connID to another logline --- irc/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/irc/client.go b/irc/client.go index 298bc37b..f6bca331 100644 --- a/irc/client.go +++ b/irc/client.go @@ -682,7 +682,7 @@ func (client *Client) run(session *Session) { if err == errInvalidUtf8 { invalidUtf8 = true // handle as normal, including labeling } else if err != nil { - client.server.logger.Debug("connect-ip", "read error from client", err.Error()) + client.server.logger.Debug("connect-ip", session.connID, "read error from client", err.Error()) var quitMessage string switch err { case ircreader.ErrReadQ: From 799e1b14f4c5d2fb236088c6569a594809272466 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Wed, 15 Jan 2025 22:12:40 -0500 Subject: [PATCH 4/4] delete services debug line --- irc/services.go | 1 - 1 file changed, 1 deletion(-) diff --git a/irc/services.go b/irc/services.go index 7bd9c5f1..6b85f797 100644 --- a/irc/services.go +++ b/irc/services.go @@ -223,7 +223,6 @@ func serviceRunCommand(service *ircService, server *Server, client *Client, cmd return } - server.logger.Debug("services", fmt.Sprintf("Client %s ran %s command %s", client.Nick(), service.Name, commandName)) if commandName == "help" { serviceHelpHandler(service, server, client, params, rb) } else {