mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-20 02:08:57 +00:00
Scope pino lines with filename
This commit is contained in:
@@ -14,11 +14,13 @@ import type {
|
||||
OptionalResourcesDictType,
|
||||
} from '../ts/types/OptionalResource';
|
||||
import { OptionalResourcesDictSchema } from '../ts/types/OptionalResource';
|
||||
import * as log from '../ts/logging/log';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
import { getGotOptions } from '../ts/updater/got';
|
||||
import { drop } from '../ts/util/drop';
|
||||
import { parseUnknown } from '../ts/util/schemas';
|
||||
|
||||
const log = createLogger('OptionalResourceService');
|
||||
|
||||
const RESOURCES_DICT_PATH = join(
|
||||
__dirname,
|
||||
'..',
|
||||
@@ -75,12 +77,12 @@ export class OptionalResourceService {
|
||||
timingSafeEqual(digest, Buffer.from(decl.digest, 'base64')) &&
|
||||
onDisk.length === decl.size
|
||||
) {
|
||||
log.warn(`OptionalResourceService: loaded ${name} from disk`);
|
||||
log.warn(`loaded ${name} from disk`);
|
||||
this.#cache.set(name, onDisk);
|
||||
return onDisk;
|
||||
}
|
||||
|
||||
log.warn(`OptionalResourceService: ${name} is no longer valid on disk`);
|
||||
log.warn(`${name} is no longer valid on disk`);
|
||||
} catch (error) {
|
||||
if (error.code !== 'ENOENT') {
|
||||
throw error;
|
||||
@@ -135,10 +137,7 @@ export class OptionalResourceService {
|
||||
try {
|
||||
await unlink(fullPath);
|
||||
} catch (error) {
|
||||
log.error(
|
||||
`OptionalResourceService: failed to cleanup ${subPath}`,
|
||||
error
|
||||
);
|
||||
log.error(`failed to cleanup ${subPath}`, error);
|
||||
}
|
||||
})
|
||||
);
|
||||
@@ -182,7 +181,7 @@ export class OptionalResourceService {
|
||||
await mkdir(dirname(destPath), { recursive: true });
|
||||
await writeFile(destPath, result);
|
||||
} catch (error) {
|
||||
log.error('OptionalResourceService: failed to save file', error);
|
||||
log.error('failed to save file', error);
|
||||
// Still return the data that we just fetched
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { PowerSaveBlocker } from 'electron';
|
||||
import * as log from '../ts/logging/log';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
|
||||
const log = createLogger('PreventDisplaySleepService');
|
||||
|
||||
export class PreventDisplaySleepService {
|
||||
private blockerId: undefined | number;
|
||||
|
||||
@@ -6,9 +6,11 @@ import { Menu, Tray, app, nativeImage, nativeTheme, screen } from 'electron';
|
||||
import os from 'node:os';
|
||||
import { join } from 'node:path';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import * as log from '../ts/logging/log';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
import type { LocalizerType } from '../ts/types/I18N';
|
||||
|
||||
const log = createLogger('SystemTrayService');
|
||||
|
||||
export type SystemTrayServiceOptionsType = Readonly<{
|
||||
i18n: LocalizerType;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import * as log from '../ts/logging/log';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
import OS from '../ts/util/os/osMain';
|
||||
import {
|
||||
parseSystemTraySetting,
|
||||
@@ -10,6 +10,8 @@ import {
|
||||
import { isSystemTraySupported } from '../ts/types/Settings';
|
||||
import type { ConfigType } from './base_config';
|
||||
|
||||
const log = createLogger('SystemTraySettingCache');
|
||||
|
||||
/**
|
||||
* A small helper class to get and cache the `system-tray-setting` preference in the main
|
||||
* process.
|
||||
|
||||
@@ -9,11 +9,13 @@ import {
|
||||
sendDummyKeystroke,
|
||||
} from '@indutny/simple-windows-notifications';
|
||||
|
||||
import * as log from '../ts/logging/log';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
import { AUMID } from './startup_config';
|
||||
import type { WindowsNotificationData } from '../ts/services/notifications';
|
||||
import { renderWindowsToast } from './renderWindowsToast';
|
||||
|
||||
const log = createLogger('WindowsNotifications');
|
||||
|
||||
export { sendDummyKeystroke };
|
||||
|
||||
const notifier = new Notifier(AUMID);
|
||||
|
||||
@@ -42,7 +42,7 @@ import { safeParseInteger } from '../ts/util/numbers';
|
||||
import { parseLoose } from '../ts/util/schemas';
|
||||
import { sleep } from '../ts/util/sleep';
|
||||
import { toWebStream } from '../ts/util/toWebStream';
|
||||
import * as log from '../ts/logging/log';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
import {
|
||||
deleteAll as deleteAllAttachments,
|
||||
deleteAllBadges,
|
||||
@@ -62,6 +62,8 @@ import {
|
||||
getTempPath,
|
||||
} from './attachments';
|
||||
|
||||
const log = createLogger('attachment_channel');
|
||||
|
||||
let initialized = false;
|
||||
|
||||
const ERASE_ATTACHMENTS_KEY = 'erase-attachments';
|
||||
@@ -731,13 +733,13 @@ function handleRangeRequest({
|
||||
// Chromium only sends open-ended ranges: "start-"
|
||||
const match = range.match(/^bytes=(\d+)-$/);
|
||||
if (match == null) {
|
||||
log.error(`attachment_channel: invalid range header: ${range}`);
|
||||
log.error(`invalid range header: ${range}`);
|
||||
return create200Response();
|
||||
}
|
||||
|
||||
const startParam = safeParseInteger(match[1]);
|
||||
if (startParam == null) {
|
||||
log.error(`attachment_channel: invalid range header: ${range}`);
|
||||
log.error(`invalid range header: ${range}`);
|
||||
return create200Response();
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,9 @@ import {
|
||||
} from '../ts/AttachmentCrypto';
|
||||
import type { LocalAttachmentV2Type } from '../ts/types/Attachment';
|
||||
import * as Errors from '../ts/types/errors';
|
||||
import * as log from '../ts/logging/log';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
|
||||
const log = createLogger('attachments');
|
||||
|
||||
const PATH = 'attachments.noindex';
|
||||
const AVATAR_PATH = 'avatars.noindex';
|
||||
|
||||
@@ -7,7 +7,9 @@ import { sync as writeFileSync } from 'write-file-atomic';
|
||||
import { get } from 'lodash';
|
||||
import { set } from 'lodash/fp';
|
||||
import { strictAssert } from '../ts/util/assert';
|
||||
import * as log from '../ts/logging/log';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
|
||||
const log = createLogger('base_config');
|
||||
|
||||
const ENCODING = 'utf8';
|
||||
|
||||
|
||||
@@ -12,7 +12,9 @@ import {
|
||||
setEnvironment,
|
||||
parseEnvironment,
|
||||
} from '../ts/environment';
|
||||
import * as log from '../ts/logging/log';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
|
||||
const log = createLogger('config');
|
||||
|
||||
// In production mode, NODE_ENV cannot be customized by the user
|
||||
if (app.isPackaged) {
|
||||
@@ -52,7 +54,7 @@ const config: IConfig = require('config');
|
||||
|
||||
if (getEnvironment() !== Environment.PackagedApp) {
|
||||
config.util.getConfigSources().forEach(source => {
|
||||
log.info(`config: Using config source ${basename(source.name)}`);
|
||||
log.info(`Using config source ${basename(source.name)}`);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,9 @@ import { readFile } from 'fs/promises';
|
||||
import { DNSFallbackSchema } from '../ts/types/DNSFallback';
|
||||
import type { DNSFallbackType } from '../ts/types/DNSFallback';
|
||||
import { parseUnknown } from '../ts/util/schemas';
|
||||
import * as log from '../ts/logging/log';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
|
||||
const log = createLogger('dns-fallback');
|
||||
|
||||
let cached: DNSFallbackType | undefined;
|
||||
|
||||
|
||||
@@ -6,10 +6,12 @@ import os from 'node:os';
|
||||
|
||||
import * as Errors from '../ts/types/errors';
|
||||
import { redactAll } from '../ts/util/privacy';
|
||||
import * as log from '../ts/logging/log';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
import { reallyJsonStringify } from '../ts/util/reallyJsonStringify';
|
||||
import type { LocaleType } from './locale';
|
||||
|
||||
const log = createLogger('global_errors');
|
||||
|
||||
// We use hard-coded strings until we're able to update these strings from the locale.
|
||||
let quitText = 'Quit';
|
||||
let copyErrorAndQuitText = 'Copy error and quit';
|
||||
|
||||
@@ -46,7 +46,7 @@ import type { ThemeSettingType } from '../ts/types/StorageUIKeys';
|
||||
import { ThemeType } from '../ts/types/Util';
|
||||
import * as Errors from '../ts/types/errors';
|
||||
import { resolveCanonicalLocales } from '../ts/util/resolveCanonicalLocales';
|
||||
import * as log from '../ts/logging/log';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
import * as debugLog from '../ts/logging/debuglogs';
|
||||
import * as uploadDebugLog from '../ts/logging/uploadDebugLog';
|
||||
import { explodePromise } from '../ts/util/explodePromise';
|
||||
@@ -125,6 +125,8 @@ import { getOwn } from '../ts/util/getOwn';
|
||||
import { safeParseLoose, safeParseUnknown } from '../ts/util/schemas';
|
||||
import { getAppErrorIcon } from '../ts/util/getAppErrorIcon';
|
||||
|
||||
const log = createLogger('app/main');
|
||||
|
||||
const animationSettings = systemPreferences.getAnimationSettings();
|
||||
|
||||
if (OS.isMacOS()) {
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
import type { session as ElectronSession, Session } from 'electron';
|
||||
|
||||
import type { ConfigType } from './base_config';
|
||||
import * as log from '../ts/logging/log';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
|
||||
const log = createLogger('permissions');
|
||||
|
||||
const PERMISSIONS: Record<string, boolean> = {
|
||||
// Allowed
|
||||
|
||||
@@ -15,7 +15,9 @@ import {
|
||||
getTempPath,
|
||||
getUpdateCachePath,
|
||||
} from './attachments';
|
||||
import * as log from '../ts/logging/log';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
|
||||
const log = createLogger('protocol_filter');
|
||||
|
||||
type CallbackType = (response: string | ProtocolResponse) => void;
|
||||
|
||||
|
||||
@@ -11,9 +11,11 @@ import type { MenuListType } from '../ts/types/menu';
|
||||
import type { LocalizerType } from '../ts/types/Util';
|
||||
import { strictAssert } from '../ts/util/assert';
|
||||
import type { LoggerType } from '../ts/types/Logging';
|
||||
import * as log from '../ts/logging/log';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
import { handleAttachmentRequest } from './attachment_channel';
|
||||
|
||||
const log = createLogger('spell_check');
|
||||
|
||||
export const FAKE_DEFAULT_LOCALE = 'und'; // 'und' is the BCP 47 subtag for "undetermined"
|
||||
|
||||
strictAssert(
|
||||
|
||||
@@ -4,9 +4,11 @@
|
||||
import { app } from 'electron';
|
||||
|
||||
import packageJson from '../package.json';
|
||||
import * as log from '../ts/logging/log';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
import * as GlobalErrors from './global_errors';
|
||||
|
||||
const log = createLogger('startup_config');
|
||||
|
||||
GlobalErrors.addHandler();
|
||||
|
||||
// Set umask early on in the process lifecycle to ensure file permissions are
|
||||
|
||||
@@ -7,9 +7,11 @@ import { app } from 'electron';
|
||||
|
||||
import { start } from './base_config';
|
||||
import config from './config';
|
||||
import * as log from '../ts/logging/log';
|
||||
import { createLogger } from '../ts/logging/log';
|
||||
import * as Errors from '../ts/types/errors';
|
||||
|
||||
const log = createLogger('user_config');
|
||||
|
||||
let userData: string | undefined;
|
||||
// Use separate data directory for benchmarks & development
|
||||
if (config.has('storagePath')) {
|
||||
|
||||
Reference in New Issue
Block a user