refactor: standardize logging on zap across all packages

Replace all fmt.Printf/Println and log.Printf/Fatal with structured
zap.Logger calls to eliminate inconsistent logging (anti-pattern #12).

- network/crypt_conn: inject logger via NewCryptConn, replace 6 fmt calls
- signserver/session: use existing s.logger for debug packet dumps
- entranceserver: use s.logger for inbound/outbound debug logging
- api/utils: accept logger param in verifyPath, replace fmt.Println
- api/endpoints: use s.logger for screenshot path diagnostics
- config: replace log.Fatal with error return in getOutboundIP4
- deltacomp: replace log.Printf with zap.L() global logger
This commit is contained in:
Houmgaor
2026-02-20 18:59:12 +01:00
parent e5133e5dcf
commit 06cb3afa57
15 changed files with 134 additions and 117 deletions

View File

@@ -3,7 +3,8 @@ package deltacomp
import (
"bytes"
"io"
"log"
"go.uber.org/zap"
)
func checkReadUint8(r *bytes.Reader) (uint8, error) {
@@ -77,7 +78,7 @@ func ApplyDataDiff(diff []byte, baseData []byte) []byte {
// Grow slice if it's required
if len(baseCopy) < dataOffset {
log.Printf("Slice smaller than data offset, growing slice...")
zap.L().Warn("Slice smaller than data offset, growing slice")
baseCopy = append(baseCopy, make([]byte, (dataOffset+differentCount)-len(baseData))...)
} else {
length := len(baseCopy[dataOffset:])