Skip to content

Commit

Permalink
docs: add text explaining the .getStore
Browse files Browse the repository at this point in the history
  • Loading branch information
blacha committed Oct 17, 2024
1 parent 56ad68a commit fa73053
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/shared/src/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit fa73053

Please sign in to comment.