From b64908d01d31722f8b9419a929a7d7f311558da1 Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Tue, 21 Sep 2021 12:17:17 -0700 Subject: [PATCH] Fix sticker-creator startup issue --- ts/logging/log.ts | 3 +-- ts/logging/shared.ts | 14 +++----------- ts/types/Logging.ts | 11 +++++++++++ 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/ts/logging/log.ts b/ts/logging/log.ts index 689db12875..0300de33b9 100644 --- a/ts/logging/log.ts +++ b/ts/logging/log.ts @@ -2,8 +2,7 @@ // SPDX-License-Identifier: AGPL-3.0-only import { noop } from 'lodash'; -import { LogLevel } from './shared'; -import { LogFunction } from '../types/Logging'; +import { LogFunction, LogLevel } from '../types/Logging'; type LogAtLevelFnType = ( level: LogLevel, diff --git a/ts/logging/shared.ts b/ts/logging/shared.ts index e1830f60d2..00f4b7c263 100644 --- a/ts/logging/shared.ts +++ b/ts/logging/shared.ts @@ -6,6 +6,9 @@ import { isRecord } from '../util/isRecord'; import { redactAll } from '../util/privacy'; import { missingCaseError } from '../util/missingCaseError'; import { reallyJsonStringify } from '../util/reallyJsonStringify'; +import { LogLevel } from '../types/Logging'; + +export { LogLevel }; export type FetchLogIpcData = { capabilities: Record; @@ -30,17 +33,6 @@ export const isFetchLogIpcData = (data: unknown): data is FetchLogIpcData => isRecord(data.user) && Array.isArray(data.logEntries); -// These match [Pino's recommendations][0]. -// [0]: https://getpino.io/#/docs/api?id=loggerlevels-object -export enum LogLevel { - Fatal = 60, - Error = 50, - Warn = 40, - Info = 30, - Debug = 20, - Trace = 10, -} - // These match [Pino's core fields][1]. // [1]: https://getpino.io/#/?id=usage export type LogEntryType = Readonly<{ diff --git a/ts/types/Logging.ts b/ts/types/Logging.ts index a849a2a158..fab8b5bb9b 100644 --- a/ts/types/Logging.ts +++ b/ts/types/Logging.ts @@ -11,3 +11,14 @@ export type LoggerType = { debug: LogFunction; trace: LogFunction; }; + +// These match [Pino's recommendations][0]. +// [0]: https://getpino.io/#/docs/api?id=loggerlevels-object +export enum LogLevel { + Fatal = 60, + Error = 50, + Warn = 40, + Info = 30, + Debug = 20, + Trace = 10, +}