本文整理汇总了TypeScript中winston.LoggerInstance.debug方法的典型用法代码示例。如果您正苦于以下问题:TypeScript LoggerInstance.debug方法的具体用法?TypeScript LoggerInstance.debug怎么用?TypeScript LoggerInstance.debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类winston.LoggerInstance
的用法示例。
在下文中一共展示了LoggerInstance.debug方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: catch
this.redisClient.brpoplpush('incoming', 'working', 0).then((jobMessage: string) => {
this.logger.debug(`Message received from Redis server: ${jobMessage}`);
try {
this.ocrProcessingService.process(jobMessage);
} catch (e) {
this.logger.error(`${e.message}: ${e.stack}`);
}
this.redisClient.lrem('working', 1, jobMessage).then(() => { this.loop(); });
});
示例2: process
public process(jobMessage: string): void {
this.logger.debug(`Starting Job: ${jobMessage}`);
const job: IJob = this.incomingJsonMessageToJobTf.transform(jobMessage);
this.logger.debug(`The sanitized and transformed job: ${JSON.stringify(job)}`);
try {
switch (job.type) {
case JobType.TESSERACT:
this.execTesseract(job);
break;
case JobType.OCRMYPDF:
this.execOcrMyPdf(job);
break;
}
} catch (e) {
this.logger.error(`Job errored: ${e.message}`);
this.finishJob(job, e);
}
this.finishJob(job);
}
示例3: execOcrMyPdf
private execOcrMyPdf(job: IJob): void {
const commandArgs: Array<String> = [];
if (job.languages.length > 0) {
commandArgs.push(`-l`, `${job.languages.join('+')}`);
}
commandArgs.push(
...[`--skip-text`,
`${Configuration.INPUT_PATH}/${job.source}`,
`${Configuration.OUTPUT_PATH}/${job.tempFile}.pdf`,
]);
const spawn = this.spawnSync('ocrmypdf',
commandArgs,
Configuration.SPAWN_SYNC_OPTIONS);
if (spawn.status !== 0) {
throw new ServiceException(`The execution of 'ocrmypdf' command failed: ${spawn.error ? spawn.error : spawn.stderr.toString().trim()}`);
}
this.logger.debug(`OCRmyPDF command finished successfully: ${spawn.output}`);
}