From ba45e090f3baa4b60eaec724b88613869f29b4a6 Mon Sep 17 00:00:00 2001 From: Dexter Date: Wed, 19 Apr 2023 17:16:18 +0100 Subject: [PATCH] chore: make log level customisable --- libs/react-helpers/src/hooks/use-logger.ts | 6 ++---- libs/utils/src/lib/local-logger.ts | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/libs/react-helpers/src/hooks/use-logger.ts b/libs/react-helpers/src/hooks/use-logger.ts index f19227151..cf62cf218 100644 --- a/libs/react-helpers/src/hooks/use-logger.ts +++ b/libs/react-helpers/src/hooks/use-logger.ts @@ -1,13 +1,11 @@ import { useRef } from 'react'; import { BrowserTracing } from '@sentry/tracing'; import * as Sentry from '@sentry/browser'; -import type { LocalLogger } from '@vegaprotocol/utils'; +import type { LocalLogger, LoggerConf } from '@vegaprotocol/utils'; import { localLoggerFactory } from '@vegaprotocol/utils'; -interface Props { +interface Props extends LoggerConf { dsn?: string; - application?: string; - tags?: string[]; } export const useLogger = ({ dsn, ...props }: Props) => { diff --git a/libs/utils/src/lib/local-logger.ts b/libs/utils/src/lib/local-logger.ts index 52cd5f9e8..1525cad65 100644 --- a/libs/utils/src/lib/local-logger.ts +++ b/libs/utils/src/lib/local-logger.ts @@ -21,7 +21,7 @@ type ConsoleMethod = { }[keyof Console] & string; -interface LoggerConf { +export interface LoggerConf { application?: string; tags?: string[]; logLevel?: LogLevelsType;