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

disable msg logs for offchain use #1342

Open
jordy25519 opened this issue Nov 21, 2024 · 0 comments
Open

disable msg logs for offchain use #1342

jordy25519 opened this issue Nov 21, 2024 · 0 comments

Comments

@jordy25519
Copy link
Contributor

There's some appetite to disable program msg!logs for drift-rs as it pollutes stdout.
will become more annoying as more production services run on drift-rs.

related: drift-labs/drift-rs#72

thinking we can replace msg! with an opt-in feature flag to disable logs at compile time.

#[macro_export]
macro_rules! msg {
    ($msg:expr) => {
       #[cfg(not(feature = "no_log"))]
        $crate::sol_log($msg)
    };
    ($($arg:tt)*) => {
        #[cfg(not(feature = "no_log"))]
        ($crate::sol_log(&format!($($arg)*)));
    }
}
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

No branches or pull requests

1 participant