Skip to content

Commit

Permalink
feat(mini-runner/logHelper): 编译成功时输出时间 (#8569)
Browse files Browse the repository at this point in the history
* feat: 编译成功时输出时间

当使用 `dev:weapp` 调试小程序时, 多次修改代码并保存后 console 里面只会有一大串 `编译成功` , 并不能确定最后一次更改是否生效.

* feat(mini-runner/logHelper): 输出日志时输出时间

* fix(mini-runner/logHelper): 将字符串改为模板字符串以输出时间

Co-authored-by: chenjiajian <798095202@qq.com>
  • Loading branch information
kdxcxs and Chen-jj authored Jan 22, 2021
1 parent 0d13aac commit 71c73ee
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/taro-mini-runner/src/utils/logHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,35 +43,35 @@ const printBuildError = (err: Error): void => {
const printSuccess = () => {
getServeSpinner().stopAndPersist({
symbol: '✅ ',
text: chalk.green('编译成功\n')
text: chalk.green(`编译成功 ${new Date().toLocaleString()}\n`)
})
}

export const printPrerenderSuccess = (path: string) => {
getServeSpinner().stopAndPersist({
symbol: '🚀 ',
text: chalk.green(`页面 ${path} 预渲染成功`)
text: chalk.green(`页面 ${path} 预渲染成功 ${new Date().toLocaleString()}`)
})
}

export const printPrerenderFail = (path: string) => {
getServeSpinner().stopAndPersist({
symbol: '⚠️ ',
text: chalk.yellow(`页面 ${path} 预渲染失败:`)
text: chalk.yellow(`${new Date().toLocaleString()} 页面 ${path} 预渲染失败:`)
})
}

const printWarning = () => {
getServeSpinner().stopAndPersist({
symbol: '⚠️ ',
text: chalk.yellow('编译警告.\n')
text: chalk.yellow(`编译警告. ${new Date().toLocaleString()}\n`)
})
}

const printFailed = () => {
getServeSpinner().stopAndPersist({
symbol: '🙅 ',
text: chalk.red('编译失败.\n')
text: chalk.red(`编译失败. ${new Date().toLocaleString()}\n`)
})
}

Expand Down

0 comments on commit 71c73ee

Please sign in to comment.