mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 04:10:59 -05:00
Add debug logging to Logger class
This commit is contained in:
parent
fc50a6da17
commit
366cd45bbb
@ -2,4 +2,5 @@ import dayjs from 'dayjs';
|
|||||||
|
|
||||||
export default class Logger {
|
export default class Logger {
|
||||||
public static console =(logType:'log'|'error', prefix:string, message:any)=>console[logType](`[${dayjs().format('DD/MM/YY HH:mm:ss')}]`, `[${prefix}]`, message);
|
public static console =(logType:'log'|'error', prefix:string, message:any)=>console[logType](`[${dayjs().format('DD/MM/YY HH:mm:ss')}]`, `[${prefix}]`, message);
|
||||||
|
public static debug =(prefix:string, message:any)=>console.log(`[${dayjs().format('DD/MM/YY HH:mm:ss')}]`, `[${prefix}:DEBUG]`, message);
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ export class UserLevelsSvc {
|
|||||||
))
|
))
|
||||||
]});
|
]});
|
||||||
} catch (why) {
|
} catch (why) {
|
||||||
Logger.console('error', 'Cron:resetAllData:DEBUG', why)
|
Logger.debug('Cron:resetAllData', why)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset LRSstart to current Epoch and save it to config file
|
// Reset LRSstart to current Epoch and save it to config file
|
||||||
|
@ -43,7 +43,7 @@ export default async(client:TClient)=>{
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (getVideoId(1) === cachedVideoId) {
|
if (getVideoId(1) === cachedVideoId) {
|
||||||
Logger.console('log', 'YTModule:DEBUG', `New video uploaded by ${YTChannelName} and notification sent to Discord`)
|
Logger.debug('YTModule', `New video uploaded by ${YTChannelName} and notification sent to Discord`)
|
||||||
await CacheServer.delete(cacheKey).then(async()=>await CacheServer.set(cacheKey, getVideoId(0), false).then(async()=>await CacheServer.expiry(cacheKey, cacheExpiry)));
|
await CacheServer.delete(cacheKey).then(async()=>await CacheServer.set(cacheKey, getVideoId(0), false).then(async()=>await CacheServer.expiry(cacheKey, cacheExpiry)));
|
||||||
|
|
||||||
(client.channels.resolve(DiscordChannelID) as TextChannel).send({
|
(client.channels.resolve(DiscordChannelID) as TextChannel).send({
|
||||||
|
Loading…
Reference in New Issue
Block a user