about summary refs log tree commit diff
path: root/src/rt/rust_builtin.cpp
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2012-09-24 20:24:32 -0700
committerPatrick Walton <pcwalton@mimiga.net>2012-09-24 20:26:06 -0700
commitdbc00ced3a09a7a8c32d69a89b9e073252cca39d (patch)
treeede5a5e4626d0912136ab4e4f7e8a68f108ea0fc /src/rt/rust_builtin.cpp
parent00e349251107963a1669d7314d8fe530b55f9cbb (diff)
downloadrust-dbc00ced3a09a7a8c32d69a89b9e073252cca39d.tar.gz
rust-dbc00ced3a09a7a8c32d69a89b9e073252cca39d.zip
rt: Add a logging function for strings (only).
This will be the shape-free replacement for upcall_log_type.
Diffstat (limited to 'src/rt/rust_builtin.cpp')
-rw-r--r--src/rt/rust_builtin.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp
index 8829089822c..02bc86f88b6 100644
--- a/src/rt/rust_builtin.cpp
+++ b/src/rt/rust_builtin.cpp
@@ -950,6 +950,13 @@ rust_call_tydesc_glue(void *root, size_t *tydesc, size_t glue_index) {
         glue_fn(0, 0, 0, root);
 }
 
+// Don't run on the Rust stack!
+extern "C" void
+rust_log_str(uint32_t level, const char *str) {
+    rust_task *task = rust_get_current_task();
+    task->sched_loop->get_log().log(task, level, "%s", str);
+}
+
 //
 // Local Variables:
 // mode: C++