Disable exit on error for cmdline_logging

This commit is contained in:
topjohnwu
2025-09-10 09:33:56 -07:00
parent cfc2bcb665
commit 48c62a1dae
2 changed files with 1 additions and 11 deletions

View File

@@ -4,7 +4,6 @@
pub use const_format;
pub use libc;
pub use nix;
use num_traits::FromPrimitive;
pub use cstr::{
FsPathFollow, StrErr, Utf8CStr, Utf8CStrBuf, Utf8CStrBufArr, Utf8CStrBufRef, Utf8CString,
@@ -58,9 +57,6 @@ pub mod ffi {
extern "Rust" {
#[cxx_name = "log_with_rs"]
fn log_from_cxx(level: LogLevelCxx, msg: Utf8CStrRef);
#[cxx_name = "set_log_level_state"]
fn set_log_level_state_cxx(level: LogLevelCxx, enabled: bool);
fn exit_on_error(b: bool);
fn cmdline_logging();
fn parse_prop_file_rs(name: Utf8CStrRef, f: &FnBoolStrStr);
#[cxx_name = "file_readline"]
@@ -78,9 +74,3 @@ pub mod ffi {
fn map_fd_for_cxx(fd: i32, sz: usize, rw: bool) -> &'static mut [u8];
}
}
fn set_log_level_state_cxx(level: ffi::LogLevelCxx, enabled: bool) {
if let Some(level) = LogLevel::from_i32(level.repr) {
set_log_level_state(level, enabled)
}
}

View File

@@ -111,7 +111,7 @@ pub fn cmdline_logging() {
let logger = Logger {
write: cmdline_write,
flags: LogFlag::ExitOnError,
flags: 0,
};
unsafe {
LOGGER = logger;