ark_api_ffi/ffi/
core_v3.rs

1define_api_id!(4, "core-v3");
2
3use crate::ErrorCode;
4use num_enum::IntoPrimitive;
5use num_enum::TryFromPrimitive;
6
7/// Log importance level
8#[derive(
9    Copy, Clone, Debug, Ord, Hash, PartialOrd, PartialEq, Eq, IntoPrimitive, TryFromPrimitive,
10)]
11#[repr(u32)]
12pub enum LogLevel {
13    /// Error, something went seriously wrong
14    Error = 0,
15    /// Warning, something went wrong but was recovered
16    Warn = 1,
17    /// Information, information to users
18    Info = 2,
19    /// Debug, information to developers
20    Debug = 3,
21    /// Trace, low priority & potentially very verbose information for developers
22    Trace = 4,
23}
24
25#[link(wasm_import_module = "ark-core-v3")]
26extern "C" {
27    /// Log a string with the specified log level
28    pub fn core__log(level: LogLevel, str_ptr: *const u8, str_len: u32) -> ErrorCode;
29}