replace logrus with charm/log

This commit is contained in:
2026-02-18 10:41:42 +00:00
parent 51e8ac85be
commit abb33742aa
6 changed files with 6 additions and 15 deletions

View File

@@ -5,7 +5,7 @@ import (
"net"
"time"
log "github.com/sirupsen/logrus"
"github.com/charmbracelet/log"
)
type UDPConn struct {

View File

@@ -4,7 +4,7 @@ import (
"bytes"
"fmt"
log "github.com/sirupsen/logrus"
"github.com/charmbracelet/log"
)
const bufSz = 512
@@ -24,13 +24,13 @@ func NewRequest(password string) Request {
}
func (r Request) Header() []byte {
return append(r.magic, []byte("rcon")...)
return append(r.magic, "rcon"...)
}
func (r Request) Encode(cmd string) []byte {
r.buf.Reset()
r.buf.Write(r.Header())
r.buf.WriteString(fmt.Sprintf(" %s %s", r.password, cmd))
log.Tracef("Encoded request: %s", r.buf.String())
log.Debugf("Encoded request: %s", r.buf.String())
return r.buf.Bytes()
}

View File

@@ -9,5 +9,5 @@ func NewResponse() Response {
}
func (r Response) Header() []byte {
return append(r.magic, []byte("print\n")...)
return append(r.magic, "print\n"...)
}