/
githubmirror
/
sway
Обзор
Документация
Войти
/
githubmirror
/
sway
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
sway-lib-std/src/logging.sw
36 строк
652 B
Daniel Frederico Lins Leite
Better `Debug` tests and impls for primitives and std lib types (#7119)
02 май 2025, 12:40
Не верифицирован
02 май 2025, 12:40
324f04f
Код
Авторство
О чём код?
//! Allows logging of arbitrary stack types, emitted as either `Log` or `Logd` receipts. library; use ::codec::*; use ::debug::*; /// Log any stack type. /// /// # Additional Information /// /// If the type is a reference type, `log` is used. /// Otherwise `logd` is used.' /// /// # Arguments /// /// * `value`: [T] - The value to log. /// /// # Examples /// /// ```sway /// fn foo() { /// log("Fuel is blazingly fast"); /// } /// ``` #[cfg(experimental_new_encoding = false)] pub fn log<T>(value: T) { __log::<T>(value); } #[cfg(experimental_new_encoding = true)] pub fn log<T>(value: T) where T: AbiEncode, { __log::<T>(value); }