修改失败任务日志

This commit is contained in:
whyour 2021-11-01 23:06:23 +08:00
parent 2ff3869608
commit 9f7bf1f6b8

View File

@ -26,8 +26,8 @@ export default class ScheduleService {
exec(command, async (error, stdout, stderr) => {
if (error) {
await this.logger.info(
'执行任务`%s`失败,时间:%s, 错误信息:%j',
name,
'执行任务%s失败时间%s, 错误信息:%j',
command,
new Date().toLocaleString(),
error,
);
@ -35,8 +35,8 @@ export default class ScheduleService {
if (stderr) {
await this.logger.info(
'执行任务`%s`失败,时间:%s, 错误信息:%j',
name,
'执行任务%s失败时间%s, 错误信息:%j',
command,
new Date().toLocaleString(),
stderr,
);
@ -44,8 +44,8 @@ export default class ScheduleService {
});
} catch (error) {
await this.logger.info(
'执行任务`%s`失败,时间:%s, 错误信息:%j',
name,
'执行任务%s失败时间%s, 错误信息:%j',
command,
new Date().toLocaleString(),
error,
);