Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

logger.ts

21 lines315 Bytes

1// TYPES
2​
3export interface Logger {
4 log: LogFunction
5 warn: LogFunction
6 error: LogFunction
7}
8​
9type LogFunction = (...args: any[]) => void
10​
11// FUNCTIONS
12​
13let logger: Logger = console
14​
15export function getLogger(): Logger {
16 return logger
18​
19export function setLogger(newLogger: Logger) {
20 logger = newLogger