mirror of
https://github.com/thomvaill/log4brains.git
synced 2022-05-07 18:36:09 +03:00
fix(cli): print Next.js' stderr to improve debug
especially for `log4brains build` (see #26)
This commit is contained in:
committed by
Thomas Vaillant
parent
7eb267eded
commit
8f888634fd
@@ -13,11 +13,12 @@ export async function execNext(fn: () => Promise<void>): Promise<void> {
|
||||
const debug = !!process.env.DEBUG;
|
||||
|
||||
const capturer = new ConsoleCapturer();
|
||||
if (debug) {
|
||||
capturer.onLog = (method, args) => {
|
||||
capturer.onLog = (method, args, stream) => {
|
||||
if (stream === "stderr" || debug) {
|
||||
capturer.doPrintln(...["[Next] ", ...args].map((a) => chalk.dim(a)));
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
capturer.start();
|
||||
await fn();
|
||||
capturer.stop();
|
||||
|
||||
Reference in New Issue
Block a user