export class DMLog { static bDebug : boolean = true ; static d ( tag , str ) { if ( this . bDebug ) { DMLog . log_ ( console . log , 'DEBUG' , tag , str ) ; } } static i ( tag , str ) { DMLog . log_ ( console . log , 'INFO' , tag , str ) ; } static w ( tag , str ) { DMLog . log_ ( console . warn , 'WARN' , tag , str ) ; } static e ( tag , str ) { DMLog . log_ ( console . error , 'ERROR' , tag , str ) ; } static log_ ( logfunc , leval , tag , str ) { let threadName = "" ; if ( Java . available ) { Java . perform ( ( ) => { const Thread = Java . use ( 'java.lang.Thread' ) ; threadName = `[${ Thread . currentThread ( ) . getName ( ) }]` ; } ) ; } logfunc ( `[${ leval }][${ new Date ( ) . toLocaleString ( 'zh-CN' ) }][PID:${ Process . id }]${ threadName }[${ Process . getCurrentThreadId ( ) }][${ tag }]: ${ str }` ) ; } static send ( tag , content ) { let tid = Process . getCurrentThreadId ( ) ; send ( JSON . stringify ( { tid : tid , status : 'msg' , tag : tag , content : content } ) ) ; } }