Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite committed Sep 5, 2024
1 parent d284e1d commit 37c6c2d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plugin-server/src/utils/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,14 @@ export class Status implements StatusBlueprint {
const logMessage = `[${this.prompt}] ${icon} ${message}`

if (!this.logger) {
throw new Error(`Logger has been closed! Cannot log: ${logMessage}`)
if (isProdEnv()) {
// This can throw on tests if the logger is closed. We don't really want tests to be bothered with this.
throw new Error(`Logger has been closed! Cannot log: ${logMessage}`)
}
console.log(
`Logger has been closed! Cannot log: ${logMessage}. Logging to console instead due to non-prod env.`
)
return
}
if (extra instanceof Object) {
this.logger[type]({ ...extra, msg: logMessage })
Expand Down

0 comments on commit 37c6c2d

Please sign in to comment.