MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / console_log

Function console_log

crates/bindings-sys/src/lib.rs:1428–1449  ·  view source on GitHub ↗
(
    level: LogLevel,
    target: Option<&str>,
    filename: Option<&str>,
    line_number: Option<u32>,
    text: &str,
)

Source from the content-addressed store, hash-verified

1426/// [`target`]: https://docs.rs/log/latest/log/struct.Record.html#method.target
1427#[inline]
1428pub fn console_log(
1429 level: LogLevel,
1430 target: Option<&str>,
1431 filename: Option<&str>,
1432 line_number: Option<u32>,
1433 text: &str,
1434) {
1435 let opt_ptr = |b: Option<&str>| b.map_or(ptr::null(), |b| b.as_ptr());
1436 let opt_len = |b: Option<&str>| b.map_or(0, |b| b.len());
1437 unsafe {
1438 raw::console_log(
1439 level as u8,
1440 opt_ptr(target),
1441 opt_len(target),
1442 opt_ptr(filename),
1443 opt_len(filename),
1444 line_number.unwrap_or(u32::MAX),
1445 text.as_ptr(),
1446 text.len(),
1447 )
1448 }
1449}
1450
1451/// Schedule a reducer to be called asynchronously, nonatomically, and immediately
1452/// on a best-effort basis.

Callers 2

panic_hookFunction · 0.50
logMethod · 0.50

Calls 2

unwrap_orMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…