mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-20 02:08:57 +00:00
Fix logging on initialization
This commit is contained in:
@@ -7,11 +7,8 @@ import { app } from 'electron';
|
|||||||
|
|
||||||
import { start } from './base_config';
|
import { start } from './base_config';
|
||||||
import config from './config';
|
import config from './config';
|
||||||
import { createLogger } from '../ts/logging/log';
|
|
||||||
import * as Errors from '../ts/types/errors';
|
import * as Errors from '../ts/types/errors';
|
||||||
|
|
||||||
const log = createLogger('user_config');
|
|
||||||
|
|
||||||
let userData: string | undefined;
|
let userData: string | undefined;
|
||||||
// Use separate data directory for benchmarks & development
|
// Use separate data directory for benchmarks & development
|
||||||
if (config.has('storagePath')) {
|
if (config.has('storagePath')) {
|
||||||
@@ -27,13 +24,14 @@ if (userData !== undefined) {
|
|||||||
try {
|
try {
|
||||||
mkdirSync(userData, { recursive: true });
|
mkdirSync(userData, { recursive: true });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.error('Failed to create userData', Errors.toLogFormat(error));
|
console.error('Failed to create userData', Errors.toLogFormat(error));
|
||||||
}
|
}
|
||||||
|
|
||||||
app.setPath('userData', userData);
|
app.setPath('userData', userData);
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info(`userData: ${app.getPath('userData')}`);
|
// Use console.log because logger isn't fully initialized yet
|
||||||
|
console.log(`userData: ${app.getPath('userData')}`);
|
||||||
|
|
||||||
const userDataPath = app.getPath('userData');
|
const userDataPath = app.getPath('userData');
|
||||||
const targetPath = join(userDataPath, 'config.json');
|
const targetPath = join(userDataPath, 'config.json');
|
||||||
|
|||||||
Reference in New Issue
Block a user