From 1ba7a3e9a9f12d3512f13ee8593873448dcce74d Mon Sep 17 00:00:00 2001 From: gxkl Date: Sat, 11 May 2024 15:05:40 +0800 Subject: [PATCH] fix: head 100 stderr when startup failed --- lib/cmd/start.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/cmd/start.js b/lib/cmd/start.js index 57d2fa2..041600a 100644 --- a/lib/cmd/start.js +++ b/lib/cmd/start.js @@ -265,9 +265,12 @@ class StartCommand extends Command { try { const args = [ '-n', '100', stderr ]; this.logger.error('tail %s', args.join(' ')); - const [ stdout ] = await execFile('tail', args); + const [ headStdout ] = await execFile('head', args); + const [ tailStdout ] = await execFile('tail', args); this.logger.error('Got error when startup: '); - this.logger.error(stdout); + this.logger.error(headStdout); + this.logger.error('...'); + this.logger.error(tailStdout); } catch (err) { this.logger.error('ignore tail error: %s', err); }