Implement logger on pusher
This commit is contained in:
parent
6a195be814
commit
dd89f12c2e
15 changed files with 263 additions and 72 deletions
|
@ -1,4 +1,5 @@
|
|||
import { HttpResponse } from "uWebSockets.js";
|
||||
import log from "../Services/Logger";
|
||||
|
||||
export class BaseController {
|
||||
protected addCorsHeaders(res: HttpResponse): void {
|
||||
|
@ -19,12 +20,12 @@ export class BaseController {
|
|||
} else {
|
||||
url = "";
|
||||
}
|
||||
console.error("ERROR: " + e.message + url);
|
||||
log.error("ERROR: " + e.message + url);
|
||||
} else if (typeof e === "string") {
|
||||
console.error(e);
|
||||
log.error(e);
|
||||
}
|
||||
if (e.stack) {
|
||||
console.error(e.stack);
|
||||
log.error(e.stack);
|
||||
}
|
||||
if (e.response) {
|
||||
res.writeStatus(e.response.status + " " + e.response.statusText);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue