Skip to content

Commit

Permalink
xhr: add some logs
Browse files Browse the repository at this point in the history
  • Loading branch information
krichprollsch committed Feb 15, 2024
1 parent e927743 commit 2508dc7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/xhr/xhr.zig
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@ pub const XMLHttpRequest = struct {
self.payload = try body_init.dupe(alloc);
}

log.debug("{any} {any}", .{ self.method, self.uri });

self.send_flag = true;
self.impl.yield(self);
}
Expand Down Expand Up @@ -420,6 +422,8 @@ pub const XMLHttpRequest = struct {
self.req.?.wait() catch |e| return self.onErr(e);
},
.wait => {
log.info("{any} {any} {d}", .{ self.method, self.uri, self.req.?.response.status });

self.priv_state = .done;
self.response_headers = self.req.?.response.headers.clone(self.response_headers.allocator) catch |e| return self.onErr(e);

Expand Down Expand Up @@ -506,6 +510,8 @@ pub const XMLHttpRequest = struct {
self.dispatchEvt("readystatechange");
self.dispatchProgressEvent("error", .{});
self.dispatchProgressEvent("loadend", .{});

log.debug("{any} {any} {any}", .{ self.method, self.uri, self.err });
}

pub fn _abort(self: *XMLHttpRequest) void {
Expand Down

0 comments on commit 2508dc7

Please sign in to comment.