Update Logger 7

This commit is contained in:
Rokojori 2026-07-17 21:21:53 +02:00
parent 77088d4ac1
commit eb275c9669
1 changed files with 11 additions and 1 deletions

View File

@ -73,6 +73,13 @@ export class RJLog
return output.join( "" ); return output.join( "" );
} }
static getDateInfo()
{
const d = new Date();
const pad = ( n: number ) => String( n ).padStart( 2, '0' );
return `${ d.getFullYear() }-${ pad( d.getDate() ) }-${ pad( d.getMonth() + 1 ) } ${ pad( d.getHours() ) }:${ pad( d.getMinutes() ) } +${ d.getSeconds() }s`;
}
static getLineInfo( color:string = RJLog.logColor, stackTrace?:string, lineIndex:number = 3 ) static getLineInfo( color:string = RJLog.logColor, stackTrace?:string, lineIndex:number = 3 )
{ {
stackTrace = stackTrace || ( new Error().stack + "" ); stackTrace = stackTrace || ( new Error().stack + "" );
@ -98,7 +105,10 @@ export class RJLog
return color + " <Unknown> " + RJLog.resetColor ; return color + " <Unknown> " + RJLog.resetColor ;
} }
return color + " " + result[ 1 ] + "(" + result[ 2 ] + ") " + RJLog.resetColor;
let ti
return color + " " + result[ 1 ] + "(" + result[ 2 ] + ") " + RJLog.getDateInfo() + RJLog.resetColor;
} }