Skip to content

Commit 2638b8d

Browse files
committed
xhr: add some logs
1 parent 0842daa commit 2638b8d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/xhr/xhr.zig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,8 @@ pub const XMLHttpRequest = struct {
379379
self.payload = try body_init.dupe(alloc);
380380
}
381381

382+
log.debug("{any} {any}", .{ self.method, self.uri });
383+
382384
self.send_flag = true;
383385
self.impl.yield(self);
384386
}
@@ -420,6 +422,8 @@ pub const XMLHttpRequest = struct {
420422
self.req.?.wait() catch |e| return self.onErr(e);
421423
},
422424
.wait => {
425+
log.info("{any} {any} {d}", .{ self.method, self.uri, self.req.?.response.status });
426+
423427
self.priv_state = .done;
424428
self.response_headers = self.req.?.response.headers.clone(self.response_headers.allocator) catch |e| return self.onErr(e);
425429

@@ -506,6 +510,8 @@ pub const XMLHttpRequest = struct {
506510
self.dispatchEvt("readystatechange");
507511
self.dispatchProgressEvent("error", .{});
508512
self.dispatchProgressEvent("loadend", .{});
513+
514+
log.debug("{any} {any} {any}", .{ self.method, self.uri, self.err });
509515
}
510516

511517
pub fn _abort(self: *XMLHttpRequest) void {

0 commit comments

Comments
 (0)