use log instead of info

pull/5370/head
yann300 2 years ago committed by Aniket
parent 0603245ec0
commit a34a7cee72
  1. 2
      libs/remix-lib/src/types/ICompilerApi.ts
  2. 4
      libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts
  3. 2
      libs/remix-ui/solidity-unit-testing/src/lib/solidity-unit-testing.tsx
  4. 4
      libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
  5. 2
      libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx
  6. 4
      libs/remixd/src/services/foundryClient.ts
  7. 4
      libs/remixd/src/services/hardhatClient.ts
  8. 4
      libs/remixd/src/services/truffleClient.ts

@ -49,7 +49,7 @@ export interface ICompilerApi {
} }
export type terminalLog = { export type terminalLog = {
type: 'info' | 'error' | 'warning' type: 'info' | 'error' | 'warning' | 'log'
value: string value: string
} }

@ -157,7 +157,7 @@ export class CompileTabLogic {
this.api.writeFile(configFilePath, fileContent) this.api.writeFile(configFilePath, fileContent)
_paq.push(['trackEvent', 'compiler', 'runCompile', 'compileWithHardhat']) _paq.push(['trackEvent', 'compiler', 'runCompile', 'compileWithHardhat'])
this.api.compileWithHardhat(configFilePath).then((result) => { this.api.compileWithHardhat(configFilePath).then((result) => {
this.api.logToTerminal({ type: 'info', value: result }) this.api.logToTerminal({ type: 'log', value: result })
}).catch((error) => { }).catch((error) => {
this.api.logToTerminal({ type: 'error', value: error }) this.api.logToTerminal({ type: 'error', value: error })
}) })
@ -183,7 +183,7 @@ export class CompileTabLogic {
this.api.writeFile(configFilePath, fileContent) this.api.writeFile(configFilePath, fileContent)
_paq.push(['trackEvent', 'compiler', 'runCompile', 'compileWithTruffle']) _paq.push(['trackEvent', 'compiler', 'runCompile', 'compileWithTruffle'])
this.api.compileWithTruffle(configFilePath).then((result) => { this.api.compileWithTruffle(configFilePath).then((result) => {
this.api.logToTerminal({ type: 'info', value: result }) this.api.logToTerminal({ type: 'log', value: result })
}).catch((error) => { }).catch((error) => {
this.api.logToTerminal({ type: 'error', value: error }) this.api.logToTerminal({ type: 'error', value: error })
}) })

@ -259,7 +259,7 @@ export const SolidityUnitTesting = (props: Record<string, any>) => { // eslint-d
finalLogs = finalLogs + '&emsp;' + formattedLog + '\n' finalLogs = finalLogs + '&emsp;' + formattedLog + '\n'
} }
_paq.push(['trackEvent', 'solidityUnitTesting', 'hardhat', 'console.log']) _paq.push(['trackEvent', 'solidityUnitTesting', 'hardhat', 'console.log'])
testTab.call('terminal', 'log', { type: 'info', value: finalLogs }) testTab.call('terminal', 'log', { type: 'log', value: finalLogs })
} }
const discardHighlight = async () => { const discardHighlight = async () => {

@ -280,11 +280,11 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
try { try {
const compilerState = await props.analysisModule.call('solidity', 'getCompilerState') const compilerState = await props.analysisModule.call('solidity', 'getCompilerState')
const { currentVersion, optimize, evmVersion } = compilerState const { currentVersion, optimize, evmVersion } = compilerState
await props.analysisModule.call('terminal', 'log', { type: 'info', value: '[Slither Analysis]: Running...' }) await props.analysisModule.call('terminal', 'log', { type: 'log', value: '[Slither Analysis]: Running...' })
_paq.push(['trackEvent', 'solidityStaticAnalyzer', 'analyze', 'slitherAnalyzer']) _paq.push(['trackEvent', 'solidityStaticAnalyzer', 'analyze', 'slitherAnalyzer'])
const result = await props.analysisModule.call('slither', 'analyse', state.file, { currentVersion, optimize, evmVersion }) const result = await props.analysisModule.call('slither', 'analyse', state.file, { currentVersion, optimize, evmVersion })
if (result.status) { if (result.status) {
props.analysisModule.call('terminal', 'log', { type: 'info', value: `[Slither Analysis]: Analysis Completed!! ${result.count} warnings found.` }) props.analysisModule.call('terminal', 'log', { type: 'log', value: `[Slither Analysis]: Analysis Completed!! ${result.count} warnings found.` })
const report = result.data const report = result.data
for (const item of report) { for (const item of report) {
let location: any = {} let location: any = {}

@ -90,7 +90,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
if (typeof message === 'string') { if (typeof message === 'string') {
message = { message = {
value: message, value: message,
type: 'info' type: 'log'
} }
} }
scriptRunnerDispatch({ type: message.type ? message.type : 'log', payload: { message: [message.value] } }) scriptRunnerDispatch({ type: message.type ? message.type : 'log', payload: { message: [message.value] } })

@ -83,7 +83,7 @@ export class FoundryClient extends PluginClient {
} }
if (!this.warnlog) { if (!this.warnlog) {
// @ts-ignore // @ts-ignore
this.call('terminal', 'log', { type: 'info', value: 'receiving compilation result from Foundry' }) this.call('terminal', 'log', { type: 'log', value: 'receiving compilation result from Foundry' })
this.warnlog = true this.warnlog = true
} }
} }
@ -167,6 +167,6 @@ export class FoundryClient extends PluginClient {
console.log('syncing from Foundry') console.log('syncing from Foundry')
this.processArtifact() this.processArtifact()
// @ts-ignore // @ts-ignore
this.call('terminal', 'log', { type: 'info', value: 'synced with Foundry'}) this.call('terminal', 'log', { type: 'log', value: 'synced with Foundry'})
} }
} }

@ -105,12 +105,12 @@ export class HardhatClient extends PluginClient {
} }
} }
if (!this.warnLog) { if (!this.warnLog) {
this.call('terminal', 'log', { value: 'receiving compilation result from Hardhat', type: 'info'} ) this.call('terminal', 'log', { value: 'receiving compilation result from Hardhat', type: 'log'} )
this.warnLog = true this.warnLog = true
} }
if (targetsSynced.length) { if (targetsSynced.length) {
console.log(`Processing artifacts for files: ${[...new Set(targetsSynced)].join(', ')}`) console.log(`Processing artifacts for files: ${[...new Set(targetsSynced)].join(', ')}`)
this.call('terminal', 'log', { type: 'info', value: `synced with Hardhat: ${[...new Set(targetsSynced)].join(', ')}` }) this.call('terminal', 'log', { type: 'log', value: `synced with Hardhat: ${[...new Set(targetsSynced)].join(', ')}` })
} }
} }

@ -81,7 +81,7 @@ export class TruffleClient extends PluginClient {
} }
if (!this.warnLog) { if (!this.warnLog) {
// @ts-ignore // @ts-ignore
this.call('terminal', 'log', { type: 'info', value: 'receiving compilation result from Truffle' }) this.call('terminal', 'log', { type: 'log', value: 'receiving compilation result from Truffle' })
this.warnLog = true this.warnLog = true
} }
} }
@ -141,6 +141,6 @@ export class TruffleClient extends PluginClient {
console.log('syncing from Truffle') console.log('syncing from Truffle')
this.processArtifact() this.processArtifact()
// @ts-ignore // @ts-ignore
this.call('terminal', 'log', { type: 'info', value: 'synced with Truffle' }) this.call('terminal', 'log', { type: 'log', value: 'synced with Truffle' })
} }
} }

Loading…
Cancel
Save