Skip to main content

dora_log

Function dora_log 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn dora_log( context: *mut c_void, level_ptr: *const u8, level_len: usize, msg_ptr: *const u8, msg_len: usize, ) -> c_int
Expand description

Sends a structured log message from a C node.

The level_ptr/level_len fields must point to a UTF-8 string containing one of: “error”, “warn”, “info”, “debug”, “trace”.

The msg_ptr/msg_len fields must point to a UTF-8 string with the log message.

Returns 0 on success, -1 on error.

§Safety

  • The context argument must be a valid dora context from init_dora_context_from_env.
  • The pointer/length pairs must describe valid UTF-8 byte slices.