Registro de actividades (logs)
Código en Soroban
stellar contract init logging --name logging📌 Código del contrato: lib.rs
lib.rsrustCopiarEditar#![no_std]
use soroban_sdk::{contract, contractimpl, log, Env, Symbol};
#[contract]
pub struct Contract;
#[contractimpl]
impl Contract {
pub fn hello(env: Env, value: Symbol) {
log!(&env, "Hello {}", value);
}
}
mod test;📝 Resultado esperado del log:
🧠 Cuándo usar log!
log!Compilación y prueba

🧪 ¿Por qué se necesita -- --nocapture?
-- --nocapture?Last updated
Was this helpful?

