diff options
Diffstat (limited to 'rust/src/logger.rs')
| -rw-r--r-- | rust/src/logger.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/rust/src/logger.rs b/rust/src/logger.rs index 66e594fd..d2903a5a 100644 --- a/rust/src/logger.rs +++ b/rust/src/logger.rs @@ -57,6 +57,14 @@ impl Logger { Self::new_with_session(name, LOGGER_DEFAULT_SESSION_ID) } + pub fn ref_from_raw(handle: *mut BNLogger) -> Ref<Logger> { + unsafe { + Ref::new(Logger { + handle: NonNull::new(handle).unwrap(), + }) + } + } + /// Create a logger scoped with the specific [`SessionId`], hiding the logs when the session /// is not active in the UI. /// |
