Skip to content

Commit dbc00ce

Browse files
committed
rt: Add a logging function for strings (only).
This will be the shape-free replacement for upcall_log_type.
1 parent 00e3492 commit dbc00ce

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/rt/rust_builtin.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,13 @@ rust_call_tydesc_glue(void *root, size_t *tydesc, size_t glue_index) {
950950
glue_fn(0, 0, 0, root);
951951
}
952952

953+
// Don't run on the Rust stack!
954+
extern "C" void
955+
rust_log_str(uint32_t level, const char *str) {
956+
rust_task *task = rust_get_current_task();
957+
task->sched_loop->get_log().log(task, level, "%s", str);
958+
}
959+
953960
//
954961
// Local Variables:
955962
// mode: C++

src/rt/rustrt.def.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ rust_get_task
6060
rust_get_stack_segment
6161
rust_task_weaken
6262
rust_task_unweaken
63+
rust_log_str
6364
shape_log_str
6465
start_task
6566
vec_reserve_shared_actual

0 commit comments

Comments
 (0)