Test log
This commit is contained in:
7
index.js
7
index.js
@@ -156,7 +156,8 @@ async function startBot(accountName) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
childProcess.stdout.on('data', (data) => {
|
childProcess.stdout.on('data', (data) => {
|
||||||
console.log(`[${accountName}] ${data.toString()}`);
|
console.log('stdout');
|
||||||
|
console.log(`[${accountName}] ${data.toString().trim()}`);
|
||||||
if (data.includes('Press enter') || data.includes('Press any key')) {
|
if (data.includes('Press enter') || data.includes('Press any key')) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
childProcess.stdin.write('\n');
|
childProcess.stdin.write('\n');
|
||||||
@@ -164,6 +165,10 @@ async function startBot(accountName) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
childProcess.stderr.on('data', (data) => {
|
||||||
|
console.error(`[${accountName}] ${data.toString().trim()}`);
|
||||||
|
});
|
||||||
|
|
||||||
childProcess.on('exit', (code) => {
|
childProcess.on('exit', (code) => {
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
consoleLog(`[${host}] Bot process for ${accountName} exited with code ${code}. Restarting...`, 'error');
|
consoleLog(`[${host}] Bot process for ${accountName} exited with code ${code}. Restarting...`, 'error');
|
||||||
|
|||||||
Reference in New Issue
Block a user