How to println() in #[starknet::contract] mod { ...}

except one thing: how to turn off the warning?


never mind. I figured out. println works.


Any chance to println() in #[starknet::contract] mod{…} ?

got a warn msg, and no print in output.

“warn: libfunc print is not allowed in the libfuncs list experimental

or maybe there is a build flag for this?

#[starknet::contract]                                                                                                                                                        
mod Hello {                                                                                                                                                                      
   ...                                                                                                                                                                          
   // internal funct                                                                                                                                                            
   fn myFunc(ref self: @ContractState) {                                                                                                                                            
       // ignore in chain env, print in #[test] env
       println!("hello, world");
   }                                                                                                                                                                            
   ...                                                                                                                                                                      }