Log media access status to help debug user reports
This commit is contained in:
parent
f65af33e6a
commit
ad8cbbe7e5
1 changed files with 19 additions and 0 deletions
19
main.js
19
main.js
|
@ -37,6 +37,7 @@ const {
|
|||
protocol: electronProtocol,
|
||||
session,
|
||||
shell,
|
||||
systemPreferences,
|
||||
} = electron;
|
||||
|
||||
const appUserModelId = `org.whispersystems.${packageJson.name}`;
|
||||
|
@ -879,6 +880,24 @@ app.on('ready', async () => {
|
|||
logger.info('app ready');
|
||||
logger.info(`starting version ${packageJson.version}`);
|
||||
|
||||
// This logging helps us debug user reports about broken devices.
|
||||
{
|
||||
let getMediaAccessStatus;
|
||||
// This function is not supported on Linux, so we have a fallback.
|
||||
if (systemPreferences.getMediaAccessStatus) {
|
||||
getMediaAccessStatus = systemPreferences.getMediaAccessStatus.bind(
|
||||
systemPreferences
|
||||
);
|
||||
} else {
|
||||
getMediaAccessStatus = _.noop;
|
||||
}
|
||||
logger.info(
|
||||
'media access status',
|
||||
getMediaAccessStatus('microphone'),
|
||||
getMediaAccessStatus('camera')
|
||||
);
|
||||
}
|
||||
|
||||
if (!locale) {
|
||||
const appLocale = process.env.NODE_ENV === 'test' ? 'en' : app.getLocale();
|
||||
locale = loadLocale({ appLocale, logger });
|
||||
|
|
Loading…
Add table
Reference in a new issue