(prefix: string)
| 3 | } |
| 4 | |
| 5 | export function createLogger(prefix: string) { |
| 6 | const label = `[${prefix}]` |
| 7 | return { |
| 8 | log: (...args: any) => console.log(label, ...args), |
| 9 | debug: (...args: any) => console.debug(label, ...args), |
| 10 | info: (...args: any) => console.info(label, ...args), |
| 11 | warn: (...args: any) => console.warn(label, ...args), |
| 12 | error: (...args: any) => console.error(label, ...args), |
| 13 | } |
| 14 | } |