We have an event as follows :
event LogNewObject(address sender, bytes32 indexed id, bytes32 sub_states_types, bytes32 sub_states_values, address owner);
This event is called in following function :
function newObject(bytes32 _id, uint256 number_of_sub_states, bytes32[10] sub_states_types, bytes32[10] sub_states_values, address _owner) public returns(bool success) {
require(!isObject(_id));
uint256 counter=0;
for(counter; counter < number_of_sub_states; counter++) {
objectStructs[_id].state.sub_state[sub_states_types[counter]] = sub_states_values[counter];
emit LogNewObject(msg.sender, _id, bytes32(sub_states_types[counter]), bytes32(sub_states_values[counter]), _owner);
}
objectStructs[_id].owner = _owner;
objectStructs[_id].isObject = true;
objectList.push(_id);
return true;
}
I want to get the logs like remix as following picture shows :
For this purpose, I use following command :
contractInstance.events.LogNewObject({fromBlock: 0, toBlock: 'latest'}, function(error, event){ console.log(event); })
And I receive following output :
> contractInstance.events.LogNewObject({fromBlock: 0, toBlock: 'latest'}, function(error, event){ console.log(event); })
null
Subscription {
id: null,
callback: [Function],
arguments:
[ { fromBlock: '0x0',
toBlock: 'latest',
topics: [Array],
address: '0xe1623aaf57fcbe260f022404c730ae32aebe39f6' } ],
_reconnectIntervalId: null,
options:
{ subscription:
{ params: 1,
inputFormatter: [Array],
outputFormatter: [Function: bound ],
subscriptionHandler: [Function: subscriptionHandler] },
type: 'eth',
requestManager:
RequestManager {
provider: [HttpProvider],
providers: [Object],
subscriptions: {} } },
subscriptionMethod: 'logs' }
As you see, the output is not as it's expected.
I used also the command proposed by user " Jitendra Kumar. Balla". However, I receive same output and not the output similar to the remix logs output as I uploaded its screen shot above in my question. I expect this output:
What option must be added to this command to receive an output similar to remix output logs which is shown in above picture ?