steel 4.0.9

Solana smart contract framework
Documentation
use solana_program::program_error::ProgramError;

/// Logs a message.
#[inline(always)]
pub fn log(msg: String) {
    solana_program::log::sol_log(msg.as_str());
}

/// Logs the call trace and returns the error.
#[track_caller]
pub fn trace(msg: &str, error: ProgramError) -> ProgramError {
    let caller = std::panic::Location::caller();
    log(format!("{}: {}", msg, caller));
    error
}

/// Supports logging.
pub trait Loggable {
    fn log(&self);
    fn log_return(&self);
}