mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-08-21 10:33:37 +00:00
enable debug logging for Mastodon API
This commit is contained in:
parent
fd5a3eb3f8
commit
e9ae78c0b7
1 changed files with 4 additions and 2 deletions
|
@ -25,8 +25,10 @@ export class MastodonLogger {
|
|||
}
|
||||
|
||||
public error(request: FastifyRequest, error: MastodonError, status: number): void {
|
||||
if ((status < 400 && status > 499) || this.envService.env.NODE_ENV === 'development') {
|
||||
const path = new URL(request.url, getBaseUrl(request)).pathname;
|
||||
const path = new URL(request.url, getBaseUrl(request)).pathname;
|
||||
if (status >= 400 && status <= 499) { // Client errors
|
||||
this.logger.debug(`Error in mastodon endpoint ${request.method} ${path}:`, error);
|
||||
} else { // Server errors
|
||||
this.logger.error(`Error in mastodon endpoint ${request.method} ${path}:`, error);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue