No log_named_bool() ? #2436
Answered
by
mds1
CaledoniaProject
asked this question in
Help
No log_named_bool() ?
#2436
-
How can I log a bool value? |
Beta Was this translation helpful? Give feedback.
Answered by
mds1
Jul 22, 2022
Replies: 1 comment 4 replies
-
// The first one might work, but solidity might ask you to be explicit on the types
// in which case the second one should work
emit log_named_uint("name", bool ? 1 : 0)
emit log_named_uint("name", bool ? uint256(1) : 0) Alternatively, you can PR additional |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
onbjerg
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alternatively, you can PR additional
log_bool
andlog_named_bool
events to forge-std: https://github.com/foundry-rs/forge-std/blob/27e14b7f2448e5f5ac32719f51fe652aa0b0733e/src/Test.sol#L20-L25