Skip to content

Commit 9892eab

Browse files
author
jin
committed
$mol_log2: multiline in web too
1 parent d64cd53 commit 9892eab

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

build/build.node.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ namespace $ {
921921
$mol_fail_hidden( error )
922922
}
923923

924-
target.text( `console.info( '%c $mol_build Audit passed', 'color:forestgreen; font-weight:bolder' )` )
924+
target.text( `console.info( '%c place: $mol_build\nmessage: Audit passed', 'color:forestgreen; font-weight:bolder' )` )
925925

926926
return [ target ]
927927
}

log3/log3.web.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ namespace $ {
1414
if( pending ) pending()
1515

1616
let tpl = '%c'
17-
const chunks = Object.values( event )
17+
const chunks = Object.entries( event )
1818

1919
for( let i = 0 ; i < chunks.length ; ++i ) {
20-
tpl += ( typeof chunks[i] === 'string' ) ? ' ▫ %s' : ' ▫ %o'
20+
tpl += ( typeof chunks[i][1] === 'string' ) ? '%s: %s\n' : '%s: %o\n'
2121
}
2222

2323
const style = `color:${color};font-weight:bolder`
2424

25-
;( this.console[ level ] as any )( tpl , style , ... chunks )
25+
;( this.console[ level ] as any )( tpl , style , ... ( [] as any[] ).concat( ... chunks ) )
2626

2727
const self = this
2828
return ()=> self.console.groupEnd()

0 commit comments

Comments
 (0)