feat: replace standard log with charmbracelet/log
- update logging to use charmbracelet/log package
- improve log messages for server start and errors
- enhance client connection and disconnection logs
🤖
This commit is contained in:
parent
3eae584d6d
commit
899417b605
7 changed files with 68 additions and 15 deletions
|
@ -7,7 +7,7 @@ import (
|
|||
"git.smsvc.net/pomodoro/GoTomato/internal/shared"
|
||||
"git.smsvc.net/pomodoro/GoTomato/internal/websocket"
|
||||
"git.smsvc.net/pomodoro/GoTomato/pkg/models"
|
||||
"log"
|
||||
"github.com/charmbracelet/log"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
|
@ -39,9 +39,9 @@ func Start() {
|
|||
http.HandleFunc("/ws", websocket.HandleConnections)
|
||||
go websocket.SendPermanentBroadCastMessage()
|
||||
|
||||
log.Printf("Pomodoro WebSocket server started on %s\n", listen)
|
||||
log.Info("Pomodoro WebSocket server started!", "listen", listen)
|
||||
err := http.ListenAndServe(listen, nil)
|
||||
if err != nil {
|
||||
log.Fatalf("Error starting server: %v", err)
|
||||
log.Fatal("Error starting server:", "msg", err)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue