Skip to content

Commit

Permalink
More
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Feb 12, 2025
1 parent 4703c15 commit a3b872e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/fusion-runtime/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ export function wrapExecutorWithHooks({
}
loggerForExecutionRequest.set(baseExecutionRequest, execReqLogger);
}
execReqLogger = execReqLogger?.child?.(subgraphName);
execReqLogger = execReqLogger?.child?.({ subgraph: subgraphName });
if (onSubgraphExecuteHooks.length === 0) {
return baseExecutor(baseExecutionRequest);
}
Expand Down
10 changes: 3 additions & 7 deletions packages/runtime/src/plugins/useFetchDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,11 @@ export function useFetchDebug<TContext extends Record<string, any>>(opts: {
onYogaInit({ yoga }) {
fetchAPI = yoga.fetchAPI;
},
onFetch({ url, options, logger = opts.logger, requestId }) {
onFetch({ url, options, logger = opts.logger }) {
const fetchId = fetchAPI.crypto.randomUUID();
const loggerMeta: Record<string, string> = {
const fetchLogger = logger.child({
fetchId,
};
if (requestId) {
loggerMeta['requestId'] = requestId;
}
const fetchLogger = logger.child(loggerMeta);
});
const httpFetchRequestLogger = fetchLogger.child('http-fetch-request');
httpFetchRequestLogger.debug(() => ({
url,
Expand Down
10 changes: 3 additions & 7 deletions packages/runtime/src/plugins/useSubgraphExecuteDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,11 @@ export function useSubgraphExecuteDebug<
onYogaInit({ yoga }) {
fetchAPI = yoga.fetchAPI;
},
onSubgraphExecute({ executionRequest, logger = opts.logger, requestId }) {
onSubgraphExecute({ executionRequest, logger = opts.logger }) {
const subgraphExecuteId = fetchAPI.crypto.randomUUID();
const loggerMeta: Record<string, string> = {
const subgraphExecuteHookLogger = logger.child({
subgraphExecuteId,
};
if (requestId) {
loggerMeta['requestId'] = requestId;
}
const subgraphExecuteHookLogger = logger.child(loggerMeta);
});
if (executionRequest) {
const subgraphExecuteStartLogger = subgraphExecuteHookLogger.child(
'subgraph-execute-start',
Expand Down

0 comments on commit a3b872e

Please sign in to comment.