log html instead of info

pull/3058/head
yann300 2 years ago committed by Aniket
parent 16cedb3494
commit 649efccf26
  1. 12
      apps/remix-ide/src/blockchain/blockchain.js

@ -674,8 +674,9 @@ export class Blockchain extends Plugin {
const hhlogs = await this.web3().eth.getHHLogsForTx(txResult.transactionHash) const hhlogs = await this.web3().eth.getHHLogsForTx(txResult.transactionHash)
if (hhlogs && hhlogs.length) { if (hhlogs && hhlogs.length) {
let finalLogs = '<b>console.log:</b>\n' let finalLogs = <div><div><b>console.log:</b></div>
for (const log of hhlogs) { {
hhlogs.map((log) => {
let formattedLog let formattedLog
// Hardhat implements the same formatting options that can be found in Node.js' console.log, // Hardhat implements the same formatting options that can be found in Node.js' console.log,
// which in turn uses util.format: https://nodejs.org/dist/latest-v12.x/docs/api/util.html#util_util_format_format_args // which in turn uses util.format: https://nodejs.org/dist/latest-v12.x/docs/api/util.html#util_util_format_format_args
@ -686,10 +687,11 @@ export class Blockchain extends Plugin {
} else { } else {
formattedLog = log.join(' ') formattedLog = log.join(' ')
} }
finalLogs = finalLogs + '&emsp;' + formattedLog + '\n' return <div>{formattedLog}</div>
} })}
</div>
_paq.push(['trackEvent', 'udapp', 'hardhat', 'console.log']) _paq.push(['trackEvent', 'udapp', 'hardhat', 'console.log'])
this.call('terminal', 'log', { type: 'info', value: finalLogs }) this.call('terminal', 'logHtml', finalLogs)
} }
execResult = await this.web3().eth.getExecutionResultFromSimulator(txResult.transactionHash) execResult = await this.web3().eth.getExecutionResultFromSimulator(txResult.transactionHash)
if (execResult) { if (execResult) {

Loading…
Cancel
Save