From 3b7e9385f3004fa70ce4ee5b3e8e6abdb7bd2f10 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Thu, 12 Dec 2024 08:05:46 +0800 Subject: Use meselog instead of slog --- clients.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'clients.go') diff --git a/clients.go b/clients.go index eb97ebe..0744bcf 100644 --- a/clients.go +++ b/clients.go @@ -1,9 +1,10 @@ package main import ( - "log/slog" "net" "sync" + + "git.sr.ht/~runxiyu/meseircd/meselog" ) type Client struct { @@ -27,7 +28,7 @@ func (client *Client) SendRaw(s string) error { if client.conn == nil { panic("not implemented") } - slog.Debug("send", "line", s, "client", client.CID) + meselog.Debug("send", "line", s, "client", client.CID) _, err := (*client.conn).Write([]byte(s)) if err != nil { // TODO: Should shut down the netFd instead but the stdlib @@ -52,11 +53,11 @@ func (client *Client) Teardown() { (*client.conn).Close() } if !cidToClient.CompareAndDelete(client.CID, client) { - slog.Error("cid inconsistent", "cid", client.CID, "client", client) + meselog.Error("cid inconsistent", "cid", client.CID, "client", client) } if client.State >= ClientStateRegistered || client.Nick != "*" { if !nickToClient.CompareAndDelete(client.Nick, client) { - slog.Error("nick inconsistent", "nick", client.Nick, "client", client) + meselog.Error("nick inconsistent", "nick", client.Nick, "client", client) } } } -- cgit v1.2.3