fix: logger args
This commit is contained in:
1 parent
b1a87b435a
commit
8b73f51267
5 files changed
+10
-10
No files matched your search
@@ -52,7 +52,7 @@ export class JobLoggerWrapper implements ILogger {
|
||||
this.job
|
||||
.log(`[${timestamp}] ${level.toUpperCase()}: ${msg}`)
|
||||
.catch((err) => {
|
||||
this.logger.error('Error logging message to job', err);
|
||||
this.logger.error(err, 'Error logging message to job');
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -83,7 +83,7 @@ export class MediaLocalStorage implements IMediaStorage {
|
||||
const remaining = expired ? jitter : left;
|
||||
this.postponeRemoval(filepath, remaining);
|
||||
} catch (err) {
|
||||
this.log.warn(`Failed to schedule removal for file ${entry}`, err);
|
||||
this.log.warn(err, `Failed to schedule removal for file ${entry}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -29,17 +29,17 @@ const logger: Logger = pino({
|
||||
}).child({ name: 'Bootstrap' });
|
||||
|
||||
process.on('uncaughtException', (err) => {
|
||||
logger.error('Uncaught Exception:', err);
|
||||
logger.error(err, 'Uncaught Exception');
|
||||
if (err instanceof Error) {
|
||||
logger.error(err.stack);
|
||||
}
|
||||
});
|
||||
process.on('unhandledRejection', (reason, promise) => {
|
||||
logger.error('Unhandled Rejection at:', promise);
|
||||
logger.error({ promise: promise }, 'Unhandled Rejection at');
|
||||
if (reason instanceof Error) {
|
||||
logger.error(reason.stack);
|
||||
} else {
|
||||
logger.error('Unhandled rejection reason:', reason);
|
||||
logger.error(reason, 'Unhandled rejection reason');
|
||||
}
|
||||
});
|
||||
logger.info('NODE - Catching unhandled rejections and exceptions enabled');
|
||||
|
||||
@@ -69,7 +69,7 @@ export class MaintainOnlineStatusPlugin extends SessionPlugin<MaintainOnlineStat
|
||||
await this.session.setPresence(WAHAPresenceStatus.ONLINE);
|
||||
this.logger.debug('Set presence to ONLINE due to activity');
|
||||
} catch (error) {
|
||||
this.logger.debug('Failed to set presence ONLINE', error);
|
||||
this.logger.debug(error, 'Failed to set presence ONLINE');
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -91,7 +91,7 @@ export class MaintainOnlineStatusPlugin extends SessionPlugin<MaintainOnlineStat
|
||||
);
|
||||
} catch (error) {
|
||||
this.session.presence = WAHAPresenceStatus.OFFLINE;
|
||||
this.logger.debug('Failed to set presence OFFLINE', error);
|
||||
this.logger.debug(error, 'Failed to set presence OFFLINE');
|
||||
}
|
||||
this.cleanupPresenceTimeout();
|
||||
}, this.config.duration);
|
||||
|
||||
@@ -26,13 +26,13 @@ export class HttpsExpress {
|
||||
|
||||
readSync() {
|
||||
this.logger.info('Reading HTTPS certificates...');
|
||||
this.logger.info('HTTPS Key Path:', this.keyPath);
|
||||
this.logger.info(`HTTPS Key Path: ${this.keyPath}`);
|
||||
const key = fs.readFileSync(this.keyPath);
|
||||
|
||||
this.logger.info('HTTPS Cert Path:', this.certPath);
|
||||
this.logger.info(`HTTPS Cert Path: ${this.certPath}`);
|
||||
const cert = fs.readFileSync(this.certPath);
|
||||
|
||||
this.logger.info('HTTPS CA Path:', this.caPath);
|
||||
this.logger.info(`HTTPS CA Path: ${this.caPath}`);
|
||||
const ca = this.caPath ? fs.readFileSync(this.caPath) : undefined;
|
||||
|
||||
this.logger.info('HTTPS certificates read successfully');
|
||||
|
||||
Reference in new issue
Block a user