From fa7305389e843f6dae400ad9a7a371555367ac99 Mon Sep 17 00:00:00 2001 From: Blayne Chard Date: Thu, 17 Oct 2024 13:04:43 +1300 Subject: [PATCH] docs: add text explaining the .getStore --- packages/shared/src/log.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/shared/src/log.ts b/packages/shared/src/log.ts index b18df2bf8..fecdcaae2 100644 --- a/packages/shared/src/log.ts +++ b/packages/shared/src/log.ts @@ -31,6 +31,8 @@ const defaultOpts = { level: 'debug' }; export const LogConfig = { /** Get the currently configured logger */ get(): LogType { + // If this .get() is called inside a async function eg a HTTP request + // use the logger from the async context if it has one const localStorage = LogStorage.getStore()?.log; if (localStorage) return localStorage;