Eos: When I run smart contract , print doesn't work.

Created on 6 Jun 2018  Â·  5Comments  Â·  Source: EOSIO/eos

`#include

class debug : public eosio::contract {
public:
using contract::contract;

  // @abi action
  void debugfunc( account_name from, account_name to, uint64_t amount ) {
     auto header = "======== debugfunc ========";
     eosio::print( header, "\n" );
     eosio::print( "from = ", from, "  to = ", to, "  amount = ", amount, "\n" );
     eosio::print( "from = ", eosio::name{from}, "  to = ", eosio::name{to}, "  amount = ", amount, "\n" );
  }

};

EOSIO_ABI( debug, (debugfunc) )`

'wuyuans-MacBook-Pro:debug wuyuan$ cleos push action helleos debugfunc '["tom","jerry",200]' -p helloman
executed transaction: dd64468125d587d7caf3c910b2cba1bffc1345f95f844fd2168cd512676698be 120 bytes 333 us

helleos <= helleos::debugfunc {"from":"tom","to":"jerry","amount":200}

warning: transaction executed locally, but may not be confirmed by the network yet'

Most helpful comment

Try to set contracts-console in your config.ini to true

All 5 comments

print doesn't work

The version before dawn-v4.10 can only be printed

if i want print data, what should I do?

Try to set contracts-console in your config.ini to true

It's work. Thank you. @andriantolie

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hadramidah picture hadramidah  Â·  3Comments

guaiguaihw picture guaiguaihw  Â·  3Comments

hsejin314 picture hsejin314  Â·  3Comments

IvanYakimov picture IvanYakimov  Â·  3Comments

yashbhavsar007 picture yashbhavsar007  Â·  3Comments