Skip to content
Snippets Groups Projects
Commit 0b74a931 authored by Loïc Correnson's avatar Loïc Correnson
Browse files

[Ivette/server] console auto-scrolling

parent 13b0b38b
No related branches found
No related tags found
No related merge requests found
...@@ -322,15 +322,20 @@ async function _launch() { ...@@ -322,15 +322,20 @@ async function _launch() {
buffer.append(argv); buffer.append(argv);
}); });
buffer.append('\n'); buffer.append('\n');
process.stdout.on('data', buffer.append ); const logger = (text) => {
process.stderr.on('data', buffer.append ); buffer.append(text);
if (0 <= text.indexOf('\n'))
buffer.scroll();
};
process.stdout.on('data', logger );
process.stderr.on('data', logger );
process.on('error', (err) => { process.on('error', (err) => {
buffer.append('Error:',err,'\n'); buffer.append('Error:',err,'\n');
_close(err); _close(err);
}); });
process.on('exit', (status,signal) => { process.on('exit', (status,signal) => {
signal && buffer.append('Signal:',signal,'\n'); signal && buffer.log('Signal:',signal);
status && buffer.append('Exit:',status,'\n'); status && buffer.log('Exit:',status);
_close(signal || status); _close(signal || status);
}); });
// Connect to Server // Connect to Server
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment