mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-02 06:46:22 +01:00
Improve logs
This commit is contained in:
parent
0ad8454c7a
commit
f765767ee2
1 changed files with 10 additions and 4 deletions
|
@ -73,10 +73,16 @@ class Api {
|
|||
final response =
|
||||
await http.Response.fromStream(await http.Client().send(req));
|
||||
if (!_isHttpStatusGood(response.statusCode)) {
|
||||
_log.severe(
|
||||
"[request] HTTP $method (${response.statusCode}): $endpoint",
|
||||
response.body,
|
||||
);
|
||||
if (response.statusCode == 404) {
|
||||
_log.severe(
|
||||
"[request] HTTP $method (${response.statusCode}): $endpoint",
|
||||
);
|
||||
} else {
|
||||
_log.severe(
|
||||
"[request] HTTP $method (${response.statusCode}): $endpoint",
|
||||
response.body,
|
||||
);
|
||||
}
|
||||
}
|
||||
return Response(response.statusCode, response.headers,
|
||||
isResponseString ? response.body : response.bodyBytes);
|
||||
|
|
Loading…
Reference in a new issue