From 58ca32391892be290d4c588b21969e4caee6e6ac Mon Sep 17 00:00:00 2001
From: Pierre Tachoire <pierre@lightpanda.io>
Date: Thu, 28 Nov 2024 16:31:30 +0100
Subject: [PATCH] window: implement a debug() function

In order to ease debug log in js world
---
 src/html/window.zig | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/html/window.zig b/src/html/window.zig
index b81c91ba..3f31345b 100644
--- a/src/html/window.zig
+++ b/src/html/window.zig
@@ -28,6 +28,8 @@ const EventTarget = @import("../dom/event_target.zig").EventTarget;
 
 const storage = @import("../storage/storage.zig");
 
+const log = std.log.scoped(.window);
+
 // https://dom.spec.whatwg.org/#interface-window-extensions
 // https://html.spec.whatwg.org/multipage/nav-history-apis.html#window
 pub const Window = struct {
@@ -66,6 +68,10 @@ pub const Window = struct {
         return self;
     }
 
+    pub fn _debug(_: *Window, str: []const u8) void {
+        log.debug("{s}", .{str});
+    }
+
     pub fn get_self(self: *Window) *Window {
         return self;
     }