Revert "Improving log messages"

This commit is contained in:
David Négrier 2021-11-24 16:20:07 +01:00 committed by GitHub
parent 6c5f330b71
commit 6e6cdc7bde
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 203 additions and 581 deletions

View file

@ -1,6 +1,5 @@
import { HttpResponse } from "uWebSockets.js";
import { FRONT_URL } from "../Enum/EnvironmentVariable";
import log from "../Services/Logger";
export class BaseController {
protected addCorsHeaders(res: HttpResponse): void {
@ -21,12 +20,12 @@ export class BaseController {
} else {
url = "";
}
log.error("ERROR: " + e.message + url);
console.error("ERROR: " + e.message + url);
} else if (typeof e === "string") {
log.error(e);
console.error(e);
}
if (e.stack) {
log.error(e.stack);
console.error(e.stack);
}
if (e.response) {
res.writeStatus(e.response.status + " " + e.response.statusText);