How to access value of a variable from the log in Remix?


I am getting problem in understanding the working of the latest version of Remix IDE. I want to retrieve the value of the variable (i.e. Val) but can’t understand how to access the log. I am trying to run the following code:

       pragma solidity ^0.5.1;
       contract Test{
          uint8 Val = 0;
          event LogFunction(uint8);
          function testFunc() public returns (uint8) {
             emit LogFunction(Val);
             return Val;

I am getting following output when I click on deploy button:

When I click on the deploy button I am getting following output:

creation of Test pending… [vm] from: 0x5B3…eddC4to:
Test.(constructor)value: 0 weidata: 0x608…10032logs: 0hash:

I have chosen Ether as the value but why I am getting wei data above?

When I click on the green tick sign, I am getting the following:

status true Transaction mined and execution succeed transaction
hash 0x711e1fd9cd945e3d218ff11c00db230105ccad6c7daa1690447b0fe3174faece
contract address 0x0fC5025C764cE34df352757e82f7B5c4Df39A836
from 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4
to Test.(constructor) gas 3000000 gas transaction cost 131940 gas
execution cost 57372 gas
hash 0x711e1fd9cd945e3d218ff11c00db230105ccad6c7daa1690447b0fe3174faece
input 0x608…10032 decoded input {} decoded output - logs
value 0 wei

Please guide me how to check the logs? Why the value is ‘0’, even though I am incrementing?


:computer: Environment


:1234: Code to reproduce

1 Like

I am able to solve this problem. Actually when we deploy the contract (i.e. click on the deploy orange button) then we would get:
“>Test at…”

When we click on the above line, then it would display a button with the name of the function (i.e. testFunc in this case). When we click , a trasaction is generated. Then we would go to the output window of Remix IDE and click on the green ‘tick symbol’ (after reading that the transaction text has a statement ‘Test.testFunc()’), then we would get a transaction recipt (TR) and if we check the log part of the TR, we would get information about the value of variable.


1 Like

Hi @zak100,

Glad you were able to resolve.

1 Like


Thanks a lot. Actually I misunderstood that the new version has changed but I found that the Log functionality is the same. So I did the same which I was doing previously and it worked.


1 Like