Update Logger 7
This commit is contained in:
parent
77088d4ac1
commit
eb275c9669
|
|
@ -73,6 +73,13 @@ export class RJLog
|
|||
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 )
|
||||
{
|
||||
stackTrace = stackTrace || ( new Error().stack + "" );
|
||||
|
|
@ -98,7 +105,10 @@ export class RJLog
|
|||
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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue