diff options
author | Runxi Yu <me@runxiyu.org> | 2024-12-12 08:05:46 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2024-12-12 08:05:46 +0800 |
commit | 3b7e9385f3004fa70ce4ee5b3e8e6abdb7bd2f10 (patch) | |
tree | a9c6a02223b1e4f18390e075ea9fd0351953b4c0 /clients.go | |
parent | Use CID instead of connection pointers while logging (diff) | |
download | meseircd-3b7e9385f3004fa70ce4ee5b3e8e6abdb7bd2f10.tar.gz meseircd-3b7e9385f3004fa70ce4ee5b3e8e6abdb7bd2f10.tar.zst meseircd-3b7e9385f3004fa70ce4ee5b3e8e6abdb7bd2f10.zip |
Use meselog instead of slog
Diffstat (limited to 'clients.go')
-rw-r--r-- | clients.go | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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) } } } |