Skip to content

Commit

Permalink
refactor(QueryClient): use internal logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Labat committed Jan 31, 2022
1 parent 65214c3 commit 438d8fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/queryClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import { onlineManager } from './onlineManager'
import { notifyManager } from './notifyManager'
import { infiniteQueryBehavior } from './infiniteQueryBehavior'
import { CancelOptions } from './types'
import { getLogger } from './logger'

// TYPES

Expand Down Expand Up @@ -559,7 +560,7 @@ export class QueryClient {
)
// It is ok not having defaults, but it is error prone to have more than 1 default for a given key
if (process.env.NODE_ENV !== 'production' && matchingDefaults?.length > 1) {
console.warn(
getLogger().warn(
`[QueryClient] Several defaults match with key '${JSON.stringify(
queryKey
)}'. The first matching query defaults are used. Please check how query defaults are registered. Order does matter here. cf. https://react-query.tanstack.com/reference/QueryClient#queryclientsetquerydefaults.`
Expand Down

0 comments on commit 438d8fe

Please sign in to comment.