Icu 13451 desktop client logging (#2318)

* feat: 🎸 Add initial logging for desktop client
This commit is contained in:
Zhihe Li authored and GitHub committed 2024-06-07 12:12:28 -04:00
1 parent 5a7e09c70c
commit 7e89f28949
9 files changed
+53 -5

No files matched your search

@@ -3,12 +3,15 @@
* SPDX-License-Identifier: BUSL-1.1
*/
const log = require('electron-log/main');
// Convert to json
const jsonify = (data) => {
if (typeof data !== 'string') data = JSON.stringify(data);
try {
return JSON.parse(data);
} catch (e) {
log.error('jsonify:', e);
// Ignore parse errors
}
};