mirror of
https://github.com/TheNetsky/Microsoft-Rewards-Script.git
synced 2026-01-23 00:11:05 +00:00
1.0
This commit is contained in:
18
src/util/Logger.ts
Normal file
18
src/util/Logger.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
export function log(title: string, message: string, type?: 'log' | 'warn' | 'error') {
|
||||
const currentTime = new Date().toISOString()
|
||||
|
||||
switch (type) {
|
||||
case 'warn':
|
||||
console.warn(`[${currentTime}] [WARN] [${title}] ${message}`)
|
||||
break
|
||||
|
||||
case 'error':
|
||||
console.error(`[${currentTime}] [ERROR] [${title}] ${message}`)
|
||||
break
|
||||
|
||||
default:
|
||||
console.log(`[${currentTime}] [LOG] [${title}] ${message}`)
|
||||
break
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user