diff --git a/src/index.ts b/src/index.ts index 6adbfe2..fc66895 100644 --- a/src/index.ts +++ b/src/index.ts @@ -43,7 +43,7 @@ class FtpMotionPlatform implements DynamicPlatformPlugin { if (this.config.bot_token) { const bot = new Telegraf(this.config.bot_token); bot.catch((err: Error, ctx: Context) => { - this.log.error('[Telegram] Error: Update Type: ' + ctx.updateType + ', Message: ' + err.message); + this.log.error('[Telegram] ' + ctx.updateType + ' Error: ' + err.message); }); bot.start((ctx) => { if (ctx.message) { diff --git a/src/motionfs.ts b/src/motionfs.ts index 231956d..295f138 100644 --- a/src/motionfs.ts +++ b/src/motionfs.ts @@ -166,7 +166,7 @@ export class MotionFS extends FileSystem { this.log.debug('[' + camera.name + '] [Remote FTP] [' + fileName + '] Uploading file.'); return client.uploadFrom(stream, fileName); }).then(() => { - this.log.debug('[' + camera.name + '] [Remote FTP] [' + fileName + '] Uploaded file.'); + this.log('[' + camera.name + '] [Remote FTP] [' + fileName + '] Uploaded file.'); }).catch((err: Error) => { this.log.error('[' + camera.name + '] [Remote FTP] [' + fileName + '] Error uploading file: ' + err.message); }).finally(() => { @@ -179,7 +179,7 @@ export class MotionFS extends FileSystem { this.log.debug('[' + camera.name + '] [Local] [' + fileName + '] Writing file to ' + filePath + '.'); const fileStream = fs.createWriteStream(filePath); fileStream.on('finish', () => { - this.log.debug('[' + camera.name + '] [Local] [' + fileName + '] Wrote file.'); + this.log('[' + camera.name + '] [Local] [' + fileName + '] Wrote file.'); }); fileStream.on('error', (err: Error) => { this.log.error('[' + camera.name + '] [Local] [' + fileName + '] Error writing file: ' + err.message); @@ -195,7 +195,7 @@ export class MotionFS extends FileSystem { const caption = camera.caption ? { caption: fileName } : {}; this.telegram.sendPhoto(camera.chat_id, { source: stream }, caption) .then(() => { - this.log.debug('[' + camera.name + '] [Telegram] [' + fileName + '] Sent file.'); + this.log('[' + camera.name + '] [Telegram] [' + fileName + '] Sent file.'); }); } }