Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit 006ce82

Browse files
committed
feature(logging): print stack traces on fatal error
1 parent 2a2d98a commit 006ce82

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,8 @@ function errorLog(task: string, e: any) {
3838
if (e && e.toString() !== 'Error') {
3939
Logger.error(`${e}`);
4040
}
41+
if (e.stack) {
42+
Logger.unformattedError(e.stack);
43+
}
4144
process.exit(1);
4245
}

src/logger/logger.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ export class Logger {
164164
});
165165
}
166166

167+
static unformattedError(msg: string) {
168+
console.error(chalk.red(msg));
169+
}
170+
167171
/**
168172
* Prints out a blue colored DEBUG prefix. Only prints out when debug mode.
169173
*/

0 commit comments

Comments
 (0)