Skip to content

Commit

Permalink
Added extern functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuri6037 committed Jul 13, 2024
1 parent c2ca6e5 commit 682f593
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/src/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ pub trait Logger {
fn log(&self, callsite: &'static Callsite, msg: Arguments, fields: &FieldSet);
}

extern "Rust" {
pub fn logger_log(callsite: &'static Callsite, msg: Arguments, fields: &FieldSet);
}

#[cfg(test)]
mod tests {
use bp3d_logger::Level;
Expand Down
8 changes: 8 additions & 0 deletions core/src/trace/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,11 @@ pub trait Tracer {
fn span_record(&self, id: NonZeroU32, fields: &FieldSet);
fn span_exit(&self, id: NonZeroU32);
}

extern "Rust" {
pub fn tracer_register_callsite(callsite: &'static Callsite) -> NonZeroU32;
pub fn tracer_span_create(callsite: NonZeroU32, fields: &FieldSet) -> NonZeroU32;
pub fn tracer_span_enter(id: NonZeroU32);
pub fn tracer_span_record(id: NonZeroU32, fields: &FieldSet);
pub fn tracer_span_exit(id: NonZeroU32);
}

0 comments on commit 682f593

Please sign in to comment.