summaryrefslogtreecommitdiff
path: root/src/rust/tor_util/ffi.rs
diff options
context:
space:
mode:
authorChelsea Holland Komlo <me@chelseakomlo.com>2017-11-27 22:59:54 -0500
committerChelsea Holland Komlo <me@chelseakomlo.com>2017-12-21 15:29:33 -0500
commit3dfe8e6522460817100582a33a382be3c3efd988 (patch)
treebfb60d07ac6e4d66fded35794980dd268bc7f2eb /src/rust/tor_util/ffi.rs
parent719db28f54ad1fa957999f2a6256e07bdb412e4f (diff)
downloadtor-3dfe8e6522460817100582a33a382be3c3efd988.tar.gz
tor-3dfe8e6522460817100582a33a382be3c3efd988.zip
add minimal rust module for logging to tor's logger
Allows an optional no-op for testing purposes
Diffstat (limited to 'src/rust/tor_util/ffi.rs')
-rw-r--r--src/rust/tor_util/ffi.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/rust/tor_util/ffi.rs b/src/rust/tor_util/ffi.rs
index 5c3cdba4be..866d119740 100644
--- a/src/rust/tor_util/ffi.rs
+++ b/src/rust/tor_util/ffi.rs
@@ -5,8 +5,7 @@
//! called from C.
//!
-use libc::c_char;
-use tor_allocate::allocate_and_copy_string;
+use tor_log::*;
/// Returns a short string to announce Rust support during startup.
///
@@ -17,10 +16,12 @@ use tor_allocate::allocate_and_copy_string;
/// tor_free(rust_str);
/// ```
#[no_mangle]
-pub extern "C" fn rust_welcome_string() -> *mut c_char {
- let rust_welcome = String::from(
+pub extern "C" fn rust_welcome_string() {
+ tor_log_msg!(
+ LogSeverity::Notice,
+ LogDomain::LdGeneral,
+ "rust_welcome_string",
"Tor is running with Rust integration. Please report \
- any bugs you encounter.",
+ any bugs you encounter."
);
- allocate_and_copy_string(&rust_welcome)
}