]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust/logging: fix logging from plugins 12472/head
authorJason Ish <jason.ish@oisf.net>
Tue, 21 Jan 2025 15:40:34 +0000 (09:40 -0600)
committerJason Ish <jason.ish@oisf.net>
Fri, 24 Jan 2025 16:07:50 +0000 (10:07 -0600)
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

rust/src/lib.rs
rust/src/plugin.rs

index f28e4c249acefdd657b84a65f0d8c358a6bf84bd..ad280a368d2d10f14ae9a842587824160657bb60 100644 (file)
@@ -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;
index 7f3758640846c99aa2805c29686cb2ad31e1be0b..db47131848e58534ebaf211b1df61c58624e0d3e 100644 (file)
@@ -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();
     }
 }