Updated verbose behavior to always log errors, and dump them to console when verbose

This commit is contained in:
rainbow napkin 2026-10-02 20:04:02 -04:00
parent 90e3589591
commit 53746ef743
2 changed files with 9 additions and 5 deletions

View file

@ -90,9 +90,7 @@ tokeSchema.statics.calculateTokeMap = async function(){
}
//Display calculated toke sats for funsies
if(config.verbose){
console.log(`Processed ${this.commandCount} toke command callouts accross ${this.count} tokes, averaging ${(this.commandCount/this.count).toFixed(3)} tokers per toke.`);
}
}
/**

View file

@ -65,8 +65,8 @@ module.exports.errorHandler = function(res, msg, type = "Generic", status = 400)
* @param {Error} err - Exception to handle
*/
module.exports.localExceptionHandler = function(err){
//If we're being verbose and this isn't just a basic bitch
if(!err.custom && config.verbose){
//If this wasn't made by exceptionSmith
if(!err.custom){
//Log the error
module.exports.dumpError(err);
}
@ -188,6 +188,12 @@ module.exports.dumpError = async function(err, date = new Date(), subDir = 'cras
//Generate content from error
const content = `Error Date: ${date.toLocaleString()} (UTC-${date.getTimezoneOffset()/60})\nError Type: ${err.name}\nError Msg:${err.message}\nStack Trace:\n\n${err.stack}`;
//if we're not muzzled and the server is in screamy boi mode
if(!muzzle && config.verbose){
//Dump error to console
console.log(err);
}
//Dump text to file
module.exports.dumpLog(content, date.getTime(), subDir, muzzle);
}