feat(TALE-33): add debug logging with DEBUG env

This commit is contained in:
Aarnav Tale
2024-10-02 13:33:39 -04:00
parent 1d821251a9
commit 1d6066d3f0
8 changed files with 88 additions and 6 deletions
+6
View File
@@ -10,6 +10,12 @@ export default {
error: (category: string, message: string, ...args: unknown[]) => {
defaultLog('ERRO', category, message, ...args)
},
debug: (category: string, message: string, ...args: unknown[]) => {
if (process.env.DEBUG === 'true') {
defaultLog('DEBG', category, message, ...args)
}
}
}
function defaultLog(