feat(TALE-7): add proper integration logging

This commit is contained in:
Aarnav Tale
2024-07-10 19:26:59 -04:00
parent 0aa0406ea6
commit 099bd3bcb8
5 changed files with 143 additions and 28 deletions
+23
View File
@@ -0,0 +1,23 @@
export default {
info: (category: string, message: string, ...args: unknown[]) => {
defaultLog('INFO', category, message, ...args)
},
warn: (category: string, message: string, ...args: unknown[]) => {
defaultLog('WARN', category, message, ...args)
},
error: (category: string, message: string, ...args: unknown[]) => {
defaultLog('ERRO', category, message, ...args)
},
}
function defaultLog(
level: string,
category: string,
message: string,
...args: unknown[]
) {
const date = new Date().toISOString()
console.log(`${date} (${level}) [${category}] ${message}`, ...args)
}