Skip to content

disable msg logs for offchain use #1342

Closed
@jordy25519

Description

@jordy25519

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)*)));
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions