Skip to content

Commit

Permalink
$mol_log2: multiline in web too
Browse files Browse the repository at this point in the history
  • Loading branch information
jin committed Jan 19, 2025
1 parent d64cd53 commit 9892eab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build/build.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ namespace $ {
$mol_fail_hidden( error )
}

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

return [ target ]
}
Expand Down
6 changes: 3 additions & 3 deletions log3/log3.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ namespace $ {
if( pending ) pending()

let tpl = '%c'
const chunks = Object.values( event )
const chunks = Object.entries( event )

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

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

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

const self = this
return ()=> self.console.groupEnd()
Expand Down

0 comments on commit 9892eab

Please sign in to comment.