Skip to content

Commit

Permalink
improvement(core): tweak log output during builds
Browse files Browse the repository at this point in the history
Specifically, raised the level for "Syncing module sources..." and
added a touch more clarity when a module is found to be already built.
  • Loading branch information
edvald authored and thsig committed Jun 8, 2021
1 parent ba9838b commit 3766ad2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
19 changes: 8 additions & 11 deletions core/src/tasks/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,6 @@ export class BuildTask extends BaseTask {

let log: LogEntry

const logSuccess = () => {
if (log) {
log.setSuccess({
msg: chalk.green(`Done (took ${log.getDuration(1)} sec)`),
append: true,
})
}
}

if (this.force) {
log = this.log.info({
section: this.getName(),
Expand All @@ -142,7 +133,10 @@ export class BuildTask extends BaseTask {
const status = await actions.getBuildStatus({ log: this.log, module })

if (status.ready) {
logSuccess()
log.setSuccess({
msg: chalk.green(`Already built`),
append: true,
})
return { fresh: false }
}

Expand All @@ -162,7 +156,10 @@ export class BuildTask extends BaseTask {
throw err
}

logSuccess()
log.setSuccess({
msg: chalk.green(`Done (took ${log.getDuration(1)} sec)`),
append: true,
})
return result
}
}
2 changes: 1 addition & 1 deletion core/src/tasks/stage-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class StageBuildTask extends BaseTask {
let log: LogEntry | undefined = undefined

if (this.module.version.files.length > 0) {
log = this.log.info({
log = this.log.verbose({
section: this.getName(),
msg: `Syncing module sources (${pluralize("file", this.module.version.files.length, true)})...`,
status: "active",
Expand Down

0 comments on commit 3766ad2

Please sign in to comment.