Skip to content

Commit

Permalink
fix(log): log footer line was duplicated after config reload
Browse files Browse the repository at this point in the history
A side effect of this is that we always add a blank line at the bottom
of the console when using the fancy logger. I think it looks nice
in most cases, but we may want to adjust some logging later.
  • Loading branch information
edvald committed Dec 10, 2018
1 parent 2a9d52f commit a8b50b1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions garden-service/src/cli/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ export class GardenCli {

// We pass a separate placeholder to the action method, so that commands can easily have a footer
// section in their log output.
logger.info("") // Put one line between the body and the footer
const logFooter = logger.placeholder()

const contextOpts: GardenOpts = { environmentName: env, log }
Expand Down
7 changes: 2 additions & 5 deletions garden-service/src/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,12 @@ export async function processModules(
}

if (watch && !!logFooter) {
logFooter.info("")
const statusLine = logFooter.placeholder()

garden.events.on("taskGraphProcessing", () => {
statusLine.setState({ emoji: "hourglass_flowing_sand", msg: "Processing..." })
logFooter.setState({ emoji: "hourglass_flowing_sand", msg: "Processing..." })
})

garden.events.on("taskGraphComplete", () => {
statusLine.setState({ emoji: "clock2", msg: chalk.gray("Waiting for code changes") })
logFooter.setState({ emoji: "clock2", msg: chalk.gray("Waiting for code changes") })
})
}

Expand Down

0 comments on commit a8b50b1

Please sign in to comment.