Print in init and pre_upgrade

It’s me who’s doing something incorrect or it’s not possible to ic_cdk::print debug information in init and pre_upgrade hooks?

1 Like

I just made an example project.

I can see the print messages in init and post_upgrade, but not in pre_upgrade.

The spec said that the debug_print system API is available in all three places. There might be something wrong.

3 Likes

Thanks! Following your message I also made another example and got the print message for init and post_upgrade. Originally also did not noticed any message for pre_upgrade but, after applying some changes in the wasm code, stopping and starting again the replica (don’t think it was related), I finally got the print for the pre_upgrade too.

Print and pre_upgrade are therefore indeed printed, I guess that when I was debugging yesterday the condition met to run those hooks were not met therefore I did not noticed print out.

1 Like