We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e65b10 commit 8a672e2Copy full SHA for 8a672e2
lib/domains.js
@@ -1,22 +1,20 @@
1
import { cachedFetcher } from '@/lib/fetch'
2
3
-export const domainLogger = () => {
4
- if (process.env.CUSTOM_DOMAIN_LOGGER === 'true') {
5
- return {
+export const loggerInstance = process.env.CUSTOM_DOMAIN_LOGGER === 'true'
+ ? {
6
log: (message, ...args) => {
7
console.log(message, ...args)
8
},
9
error: (message, ...args) => {
10
console.error(message, ...args)
11
}
12
13
- } else {
14
+ : {
15
log: () => {},
16
error: () => {}
17
18
- }
19
-}
+
+export const domainLogger = () => loggerInstance
20
21
// fetch custom domain mappings from our API, caching it for 5 minutes
22
export const getDomainMappingsCache = cachedFetcher(async function fetchDomainMappings () {
0 commit comments