From: Jason Ish Date: Tue, 21 Jan 2025 15:40:34 +0000 (-0600) Subject: rust/logging: fix logging from plugins X-Git-Tag: suricata-8.0.0-beta1~517 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99096699c02ab4c756e40feffed27ac857db4915;p=thirdparty%2Fsuricata.git rust/logging: fix logging from plugins Commit 2bcc66da5826fa0e6e074a756754b295e5ac4da2 broke logging from plugins: - debug visibility was reduced making it unusable from an external crate - the plugins view of the log level was broken To fix: - make debug pub - minor change to initialization of the log LEVEL as seen by the plugin so its seen by the plugin. I'm not really sure why the previous version wasn't working though, but this one does --- diff --git a/rust/src/lib.rs b/rust/src/lib.rs index f28e4c249a..ad280a368d 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -83,7 +83,7 @@ extern crate suricata_derive; pub mod core; #[macro_use] -pub(crate) mod debug; +pub mod debug; pub mod common; pub mod conf; diff --git a/rust/src/plugin.rs b/rust/src/plugin.rs index 7f37586408..db47131848 100644 --- a/rust/src/plugin.rs +++ b/rust/src/plugin.rs @@ -19,9 +19,9 @@ pub fn init() { unsafe { - let context = super::core::SCGetContext(); - super::core::init_ffi(context); + let context = crate::core::SCGetContext(); + crate::core::init_ffi(context); - super::debug::SCSetRustLogLevel(super::debug::SCLogGetLogLevel()); + crate::debug::LEVEL = crate::debug::SCLogGetLogLevel(); } }