make console output clearer

This commit is contained in:
Iuri Matias 2017-02-15 20:08:47 -05:00
parent 63da0773ae
commit a511979cd1
2 changed files with 5 additions and 5 deletions

View File

@ -61,7 +61,7 @@ Deploy.prototype.checkAndDeployContract = function(contract, params, callback) {
var trackedContract = self.deployTracker.getContract(contract.className, contract.code, contract.args); var trackedContract = self.deployTracker.getContract(contract.className, contract.code, contract.args);
if (trackedContract && this.web3.eth.getCode(trackedContract.address) !== "0x") { if (trackedContract && this.web3.eth.getCode(trackedContract.address) !== "0x") {
self.logger.info(contract.className + " already deployed " + trackedContract.address); self.logger.info(contract.className.cyan + " already deployed at ".green + trackedContract.address.cyan);
contract.deployedAddress = trackedContract.address; contract.deployedAddress = trackedContract.address;
self.logger.contractsState(self.contractsManager.contractsState()); self.logger.contractsState(self.contractsManager.contractsState());
return callback(); return callback();
@ -118,12 +118,12 @@ Deploy.prototype.deployContract = function(contract, params, callback) {
gasPrice: contract.gasPrice gasPrice: contract.gasPrice
}); });
self.logger.info("deploying " + contract.className + " with " + contract.gas + " gas"); self.logger.info("deploying " + contract.className.cyan + " with ".green + contract.gas + " gas".green);
contractParams.push(function(err, transaction) { contractParams.push(function(err, transaction) {
self.logger.contractsState(self.contractsManager.contractsState()); self.logger.contractsState(self.contractsManager.contractsState());
if (err) { if (err) {
self.logger.error("error deploying contract: " + contract.className); self.logger.error("error deploying contract: " + contract.className.cyan);
var errMsg = err.toString(); var errMsg = err.toString();
if (errMsg === 'Error: The contract code couldn\'t be stored, please check your gas amount.') { if (errMsg === 'Error: The contract code couldn\'t be stored, please check your gas amount.') {
errMsg = 'The contract code couldn\'t be stored, out of gas or constructor error'; errMsg = 'The contract code couldn\'t be stored, out of gas or constructor error';
@ -132,7 +132,7 @@ Deploy.prototype.deployContract = function(contract, params, callback) {
contract.error = errMsg; contract.error = errMsg;
return callback(new Error(err)); return callback(new Error(err));
} else if (transaction.address !== undefined) { } else if (transaction.address !== undefined) {
self.logger.info(contract.className + " deployed at " + transaction.address); self.logger.info(contract.className.cyan + " deployed at ".green + transaction.address.cyan);
contract.deployedAddress = transaction.address; contract.deployedAddress = transaction.address;
contract.transactionHash = transaction.transactionHash; contract.transactionHash = transaction.transactionHash;
return callback(null, transaction.address); return callback(null, transaction.address);

View File

@ -358,7 +358,7 @@ Dashboard.prototype.layoutCmd = function() {
this.input.on('submit', function(data) { this.input.on('submit', function(data) {
if (data !== '') { if (data !== '') {
self.history.addCommand(data); self.history.addCommand(data);
self.logText.log('console> ' + data); self.logText.log('console> '.bold.green + data);
self.console.executeCmd(data, function(result) { self.console.executeCmd(data, function(result) {
self.logText.log(result); self.logText.log(result);
}); });