also looking at this
chore: change logger into stacksjs/clarity
#24
4 files
+329
-624
| @@ -6,16 +6,14 @@ export function debugLog(category: string, message: string, verbose?: boolean | | ||
| 6 | 6 | } |
| 7 | 7 | |
| 8 | 8 | if (verbose === true || config.verbose === true) { |
| 9 | // eslint-disable-next-line no-console | |
| 10 | console.debug(`[audiox:${category}] ${message}`) | |
| 9 | console.debug(message) | |
| 11 | 10 | } |
| 12 | 11 | |
| 13 | 12 | if (Array.isArray(verbose)) { |
| 14 | 13 | // Check if any of the verbose categories match the prefix |
| 15 | 14 | const matches = verbose.some(prefix => category.startsWith(prefix)) |
| 16 | 15 | if (matches) { |
| 17 | // eslint-disable-next-line no-console | |
| 18 | console.log(`[audiox:${category}] ${message}`) | |
| 16 | console.log(message) | |
| 19 | 17 | } |
| 20 | 18 | } |
| 21 | 19 | |
| @@ -23,8 +21,7 @@ export function debugLog(category: string, message: string, verbose?: boolean | | ||
| 23 | 21 | // Check if any of the verbose categories match the prefix |
| 24 | 22 | const matches = config.verbose.some(prefix => category.startsWith(prefix)) |
| 25 | 23 | if (matches) { |
| 26 | // eslint-disable-next-line no-console | |
| 27 | console.log(`[audiox:${category}] ${message}`) | |
| 24 | console.log(message) | |
| 28 | 25 | } |
| 29 | 26 | } |
| 30 | 27 | } |