Disable idb stdout buffering for logs
Summary: Changelog: Disable idb stdout buffering for logs. Show logs on iOS devices without buffering. Currently, idb buffers log output if it's redirected to a non-TTY. It is the default behavior for Python (read more about it [here](https://eklitzke.org/stdout-buffering)). It leads to users seeing logs only in large chunks because the size of the buffer is substantial. Setting PYTHONUNBUFFERED to a non-empty string disables Python output buffering. Reviewed By: lblasa Differential Revision: D32984711 fbshipit-source-id: 3e0a889b6b60b6d266f4a0c1894db937868c7433
This commit is contained in:
committed by
Facebook GitHub Bot
parent
59641d7987
commit
359e403639
@@ -70,7 +70,11 @@ export function idbStartLogListener(
|
|||||||
return child_process.spawn(
|
return child_process.spawn(
|
||||||
idbPath,
|
idbPath,
|
||||||
['log', '--udid', udid, '--', ...getLogExtraArgs(deviceType)],
|
['log', '--udid', udid, '--', ...getLogExtraArgs(deviceType)],
|
||||||
{},
|
{
|
||||||
|
env: {
|
||||||
|
PYTHONUNBUFFERED: '1',
|
||||||
|
},
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,11 @@ test('uses idb when present and xcode detected', async () => {
|
|||||||
'--debug',
|
'--debug',
|
||||||
'--info',
|
'--info',
|
||||||
],
|
],
|
||||||
{},
|
{
|
||||||
|
env: {
|
||||||
|
PYTHONUNBUFFERED: '1',
|
||||||
|
},
|
||||||
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -85,7 +89,11 @@ test('uses idb when present and xcode detected and physical device connected', a
|
|||||||
'--',
|
'--',
|
||||||
// no further args; not supported by idb atm
|
// no further args; not supported by idb atm
|
||||||
],
|
],
|
||||||
{},
|
{
|
||||||
|
env: {
|
||||||
|
PYTHONUNBUFFERED: '1',
|
||||||
|
},
|
||||||
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user