From 790706dbf1e797607dfb6c6717ab863a9e4cb5ca Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 19 Aug 2025 15:36:10 +0200 Subject: add simlpe plain text log handler and consider loglevel from the env --- go/client/game.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'go/client') diff --git a/go/client/game.go b/go/client/game.go index caf73933..3dacd209 100644 --- a/go/client/game.go +++ b/go/client/game.go @@ -3,13 +3,14 @@ package main import ( "fmt" "image/color" - "log" "github.com/hajimehoshi/ebiten/v2" "github.com/hajimehoshi/ebiten/v2/ebitenutil" "muhq.space/muhqs-game/go/activities" + "muhq.space/muhqs-game/go/assets" "muhq.space/muhqs-game/go/game" + "muhq.space/muhqs-game/go/log" "muhq.space/muhqs-game/go/ui" "muhq.space/muhqs-game/go/utils" ) @@ -544,7 +545,7 @@ func (g *Game) handlePlayerNotifications() { // FIXME } for n.Valid() { - log.Println("Received", n) + log.Debug("Received", "notification", n) switch n.Notification { case game.PriorityNotification: g.hasPriority = true @@ -616,13 +617,14 @@ func (g *Game) progressPlayAction(a *game.PlayAction) { g.addCancelablePrompt(a, fmt.Sprintf("Select targets to play %v", a.Card.Name)) g.handLayer.HighlightCard(a.Card, ui.HighlightSelectionColor) } else { + log.Debug("No targets or no selection allowed", "action", a) g.declareAction(a) } } func (g *Game) handleSelection(obj any, x, y int) { if obj == nil { - log.Printf("No object found at cursor position (%d, %d)\n", x, y) + log.Debug("No object found at cursor", "cursor", game.Position{x, y}) return } -- cgit v1.2.3