Skip to content

Commit

Permalink
rust/logging: fix logging from plugins
Browse files Browse the repository at this point in the history
Commit 2bcc66d 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
  • Loading branch information
jasonish committed Jan 24, 2025
1 parent d63ad75 commit 9909669
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions rust/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

0 comments on commit 9909669

Please sign in to comment.