Skip to content

Commit

Permalink
fix(cli): fix regression in error logging
Browse files Browse the repository at this point in the history
This fixes a regression introduced in the recent changes to our error
logging. Non-task errors weren't being logged at the end of command
runs.

We've now reinstated the logging of any errors at the end of commands.
  • Loading branch information
thsig authored and eysi09 committed Oct 15, 2020
1 parent 8d66c36 commit 6ef165a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/src/cli/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { makeEnterpriseContext } from "../enterprise/init"
import { GardenProcess } from "../db/entities/garden-process"
import { DashboardEventStream } from "../server/dashboard-event-stream"
import { GardenPlugin } from "../types/plugin/plugin"
import { formatGardenError } from "../logger/util"
import { renderError } from "../logger/renderers"

export async function makeDummyGarden(root: string, gardenOpts: GardenOpts = {}) {
const environments = gardenOpts.environmentName
Expand Down Expand Up @@ -466,9 +466,13 @@ ${renderCommands(commands)}

if (gardenErrors.length > 0) {
for (const error of gardenErrors) {
const entry = logger.error({
msg: error.message,
error,
})
// Output error details to console when log level is silly
logger.silly({
msg: formatGardenError(error),
msg: renderError(entry),
})
}

Expand Down

0 comments on commit 6ef165a

Please sign in to comment.