Skip to content

Commit 8a672e2

Browse files
committed
logger factory caching, remove later
1 parent 2e65b10 commit 8a672e2

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

lib/domains.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
import { cachedFetcher } from '@/lib/fetch'
22

3-
export const domainLogger = () => {
4-
if (process.env.CUSTOM_DOMAIN_LOGGER === 'true') {
5-
return {
3+
export const loggerInstance = process.env.CUSTOM_DOMAIN_LOGGER === 'true'
4+
? {
65
log: (message, ...args) => {
76
console.log(message, ...args)
87
},
98
error: (message, ...args) => {
109
console.error(message, ...args)
1110
}
1211
}
13-
} else {
14-
return {
12+
: {
1513
log: () => {},
1614
error: () => {}
1715
}
18-
}
19-
}
16+
17+
export const domainLogger = () => loggerInstance
2018

2119
// fetch custom domain mappings from our API, caching it for 5 minutes
2220
export const getDomainMappingsCache = cachedFetcher(async function fetchDomainMappings () {

0 commit comments

Comments
 (0)