Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 535ee4d

Browse files
committedMar 6, 2025·
lib: Improve http channel debug messages
Disambiguate the "http done" message: It was previously shown once for "client finished sending the request" (`done` channel message), and again for "request arrived and was successful". Show a more detailed message in both cases, and also include teh request method and path to disambiguate multiple parallel queries.
1 parent 253d25b commit 535ee4d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎pkg/lib/cockpit.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -2547,7 +2547,7 @@ function factory() {
25472547
channel.send(data);
25482548
});
25492549
}
2550-
http_debug("http done");
2550+
http_debug("http", req.method, req.path, "request sent, channel done");
25512551
channel.control({ command: "done" });
25522552
}
25532553

@@ -2594,10 +2594,10 @@ function factory() {
25942594
if (type.indexOf("text/plain") === 0)
25952595
message = body;
25962596
}
2597-
http_debug("http status: ", resp.status);
2597+
http_debug("http", req.method, req.path, "failed:", resp.status, resp.reason);
25982598
dfd.reject(new HttpError(resp.status, resp.reason, message), body);
25992599
} else {
2600-
http_debug("http done");
2600+
http_debug("http", req.method, req.path, "succeeded:", resp.status);
26012601
dfd.resolve(body);
26022602
}
26032603
}

0 commit comments

Comments
 (0)
Please sign in to comment.