Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: deprecate console2 #573

Merged
merged 1 commit into from
Jun 29, 2024
Merged

Conversation

DaniPopes
Copy link
Member

@DaniPopes DaniPopes commented Jun 26, 2024

Since foundry-rs/foundry#6504, Foundry treats the two types of console as the same in both traces and emitted logs. There is no reason for console2 to exist anymore, so it should be removed.

To achieve this I also had to make the console functions pure by just copying over the previous console2 logic.

To avoid a breaking change, we can just re-export console as console2 in console2.sol.

import {console as console2} from "./console.sol";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be sufficient I think

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally and this did not break my console2 usage

@mds1 mds1 merged commit 1132ac3 into foundry-rs:master Jun 29, 2024
3 checks passed
@DaniPopes DaniPopes deleted the deprecate-console2 branch June 29, 2024 19:45
@hellwolf
Copy link

hellwolf commented Jul 2, 2024

what about console2.log for int256?

    function log(string memory p0, int256 p1) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,int256)", p0, p1));
    }

?

@mds1
Copy link
Collaborator

mds1 commented Jul 2, 2024

Thanks for flagging @hellwolf, just put out v1.9.1 which resolves this: https://github.com/foundry-rs/forge-std/releases/tag/v1.9.1

@hellwolf
Copy link

hellwolf commented Jul 2, 2024

awesome, thanks folks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants