From e38f246e046c3ad50bd2f5e33d8d810d33891cbd Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Sat, 30 Jul 2022 09:16:15 +0200 Subject: [PATCH] remove obsolete code --- hermit-sys/Cargo.toml | 1 - hermit-sys/src/lib.rs | 38 +------------------------------------- 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/hermit-sys/Cargo.toml b/hermit-sys/Cargo.toml index 51d8be5e3..7d2485878 100644 --- a/hermit-sys/Cargo.toml +++ b/hermit-sys/Cargo.toml @@ -38,7 +38,6 @@ trace = [] vga = [] [dependencies] -log = { version = "0.4", default-features = false } libm = { version = "0.2", default-features = false } rftrace = { version = "0.1", optional = true, features = ["autokernel", "buildcore", "interruptsafe"] } diff --git a/hermit-sys/src/lib.rs b/hermit-sys/src/lib.rs index 71e21ee8f..2ee150cf7 100644 --- a/hermit-sys/src/lib.rs +++ b/hermit-sys/src/lib.rs @@ -1,49 +1,13 @@ #![allow(clippy::large_enum_variant)] #![allow(clippy::new_ret_no_self)] -#[macro_use] -extern crate log; - mod cmath; #[cfg(not(feature = "tcp"))] mod dummy; -use log::{set_logger, set_max_level, LevelFilter, Metadata, Record}; - -/// Data structure to filter kernel messages -struct SysLogger; - -impl log::Log for SysLogger { - fn enabled(&self, _: &Metadata) -> bool { - true - } - - fn flush(&self) { - // nothing to do - } - - fn log(&self, record: &Record) { - if self.enabled(record.metadata()) { - println!("[{}] {}", record.level(), record.args()); - } - } -} - #[no_mangle] pub extern "C" fn sys_network_init() -> i32 { - set_logger(&SysLogger).expect("Can't initialize logger"); - // Determines LevelFilter at compile time - let log_level: Option<&'static str> = option_env!("HERMIT_LOG_LEVEL_FILTER"); - let max_level: LevelFilter = match log_level { - Some("Error") => LevelFilter::Error, - Some("Debug") => LevelFilter::Debug, - Some("Off") => LevelFilter::Off, - Some("Trace") => LevelFilter::Trace, - Some("Warn") => LevelFilter::Warn, - Some("Info") => LevelFilter::Info, - _ => LevelFilter::Info, - }; - set_max_level(max_level); + // nothing to do 0 }