Skip to content

Commit d277fa9

Browse files
committed
♻️ Rename integrationIdStore
1 parent b1c00f6 commit d277fa9

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/middlewares/extract-header.middleware.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { AsyncLocalStorage } from 'async_hooks';
44

55
const DEFAULT_LOCALE = 'de-DE';
66

7-
export const integrationIdStorage = new AsyncLocalStorage<string>();
7+
export const playtypusUserIdStorage = new AsyncLocalStorage<string>();
88

99
export function extractHeaderMiddleware(
1010
req: BridgeRequest<any>,
@@ -23,5 +23,5 @@ export function extractHeaderMiddleware(
2323
locale,
2424
};
2525

26-
integrationIdStorage.run(userId, () => next());
26+
playtypusUserIdStorage.run(userId, () => next());
2727
}

src/util/logger.util.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { context, trace } from '@opentelemetry/api';
22

33
import { anonymizeKey } from './anonymize-key';
4-
import { integrationIdStorage } from '../middlewares';
4+
import { playtypusUserIdStorage } from '../middlewares';
55

66
function addMessageToTraceSpan(
77
method: 'log' | 'error' | 'warn',
@@ -30,7 +30,7 @@ export const infoLogger = (
3030
apiKey?: string,
3131
...args: unknown[]
3232
): void => {
33-
const userId = integrationIdStorage.getStore();
33+
const userId = playtypusUserIdStorage.getStore();
3434

3535
addMessageToTraceSpan('log', message, [...args, userId]);
3636

@@ -50,7 +50,7 @@ export const errorLogger = (
5050
apiKey?: string,
5151
...args: unknown[]
5252
): void => {
53-
const userId = integrationIdStorage.getStore();
53+
const userId = playtypusUserIdStorage.getStore();
5454

5555
addMessageToTraceSpan('error', message, [...args, userId]);
5656

@@ -70,7 +70,7 @@ export const warnLogger = (
7070
apiKey?: string,
7171
...args: unknown[]
7272
): void => {
73-
const userId = integrationIdStorage.getStore();
73+
const userId = playtypusUserIdStorage.getStore();
7474

7575
addMessageToTraceSpan('warn', message, [...args, userId]);
7676

@@ -86,7 +86,7 @@ const logger = (
8686
): void => {
8787
// eslint-disable-next-line no-console
8888
const anonymizedApiKey = apiKey ? anonymizeKey(apiKey) : undefined;
89-
const userId = integrationIdStorage.getStore();
89+
const userId = playtypusUserIdStorage.getStore();
9090

9191
const formatedMessage = constructLogMessage(
9292
anonymizedApiKey ? `[${anonymizedApiKey}]` : undefined,

0 commit comments

Comments
 (0)