Skip to content

Commit

Permalink
Rename logger to remoteLogger
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcginnes committed Aug 29, 2024
1 parent a2d68de commit 5e574ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions packages/graph-explorer/src/hooks/useExpandNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function ExpandNodeProvider(props: PropsWithChildren) {
const explorer = useRecoilValue(explorerSelector);
const [_, setEntities] = useEntities();
const { enqueueNotification, clearNotification } = useNotification();
const logger = useRecoilValue(loggerSelector);
const remoteLogger = useRecoilValue(loggerSelector);

const mutation = useMutation({
mutationFn: async (
Expand Down Expand Up @@ -89,7 +89,7 @@ export function ExpandNodeProvider(props: PropsWithChildren) {
});
},
onError: error => {
logger.error(`Failed to expand node: ${error.message}`);
remoteLogger.error(`Failed to expand node: ${error.message}`);
const displayError = createDisplayError(error);
// Notify the user of the error
enqueueNotification({
Expand Down
12 changes: 6 additions & 6 deletions packages/graph-explorer/src/hooks/useSchemaSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useRecoilValue } from "recoil";
const useSchemaSync = (onSyncChange?: (isSyncing: boolean) => void) => {
const config = useConfiguration();
const explorer = useRecoilValue(explorerSelector);
const logger = useRecoilValue(loggerSelector);
const remoteLogger = useRecoilValue(loggerSelector);

const updatePrefixes = usePrefixesUpdater();
const { enqueueNotification, clearNotification } = useNotification();
Expand Down Expand Up @@ -40,7 +40,7 @@ const useSchemaSync = (onSyncChange?: (isSyncing: boolean) => void) => {
type: "info",
stackable: true,
});
logger.info(
remoteLogger.info(
`[${
config.displayLabel || config.id
}] This connection has no data available: ${JSON.stringify(
Expand All @@ -59,7 +59,7 @@ const useSchemaSync = (onSyncChange?: (isSyncing: boolean) => void) => {
type: "success",
stackable: true,
});
logger.info(
remoteLogger.info(
`[${
config.displayLabel || config.id
}] Connection successfully synchronized: ${JSON.stringify(
Expand All @@ -82,13 +82,13 @@ const useSchemaSync = (onSyncChange?: (isSyncing: boolean) => void) => {
stackable: true,
});
if (e instanceof Error && e.name === "AbortError") {
logger.error(
remoteLogger.error(
`[${
config.displayLabel || config.id
}] Fetch aborted, reached max time out ${config.connection?.fetchTimeoutMs} MS`
);
} else {
logger.error(
remoteLogger.error(
`[${
config.displayLabel || config.id
}] Error while fetching schema: ${e instanceof Error ? e.message : "Unexpected error"}`
Expand All @@ -104,7 +104,7 @@ const useSchemaSync = (onSyncChange?: (isSyncing: boolean) => void) => {
enqueueNotification,
replaceSchema,
clearNotification,
logger,
remoteLogger,
updatePrefixes,
setSyncFailure,
]);
Expand Down

0 comments on commit 5e574ba

Please sign in to comment.