From 6eb0271f83cb94340d5789344a1bfa22b06e8c54 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 6 Sep 2024 18:37:51 +0900 Subject: [PATCH] internal/graphicscommand: better log for read/write pixels --- internal/graphicscommand/command.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/internal/graphicscommand/command.go b/internal/graphicscommand/command.go index 71bfc6434..d69d7ed8a 100644 --- a/internal/graphicscommand/command.go +++ b/internal/graphicscommand/command.go @@ -221,7 +221,11 @@ type writePixelsCommandArgs struct { } func (c *writePixelsCommand) String() string { - return fmt.Sprintf("write-pixels: dst: %d, len(args): %d", c.dst.id, len(c.args)) + var args []string + for _, a := range c.args { + args = append(args, fmt.Sprintf("region: %s", a.region.String())) + } + return fmt.Sprintf("write-pixels: dst: %d, args: %s", c.dst.id, strings.Join(args, ", ")) } // Exec executes the writePixelsCommand. @@ -270,7 +274,11 @@ func (c *readPixelsCommand) NeedsSync() bool { } func (c *readPixelsCommand) String() string { - return fmt.Sprintf("read-pixels: image: %d", c.img.id) + var args []string + for _, a := range c.args { + args = append(args, fmt.Sprintf("region: %s", a.Region.String())) + } + return fmt.Sprintf("read-pixels: image: %d, args: %v", c.img.id, strings.Join(args, ", ")) } // disposeImageCommand represents a command to dispose an image.