Merge "Remove use of deprecated logging functions" into main
diff --git a/rust/Android.bp b/rust/Android.bp
index dea6adb..ed0ce53 100644
--- a/rust/Android.bp
+++ b/rust/Android.bp
@@ -87,13 +87,6 @@
}
rust_test {
- name: "logger_test_config_log_level_deprecated",
- defaults: ["liblogger_test_defaults"],
- host_supported: true,
- srcs: ["tests/config_log_level_deprecated.rs"],
-}
-
-rust_test {
name: "logger_test_multiple_init",
defaults: ["liblogger_test_defaults"],
host_supported: true,
diff --git a/rust/logger.rs b/rust/logger.rs
index 4664cf8..c1a77a8 100644
--- a/rust/logger.rs
+++ b/rust/logger.rs
@@ -36,13 +36,6 @@
/// Based on android_logger::Config
impl<'a> Config<'a> {
- // TODO: Remove on 0.13 version release.
- /// **DEPRECATED**, use [`Config::with_max_level()`] instead.
- #[deprecated(note = "use `.with_max_level()` instead")]
- pub fn with_min_level(self, level: log::Level) -> Self {
- self.with_max_level(level.to_level_filter())
- }
-
/// Changes the maximum log level.
///
/// Note, that `Trace` is the maximum level, because it provides the
@@ -155,15 +148,6 @@
use super::*;
#[test]
- fn test_with_min_level() {
- let config = Config::default()
- .with_min_level(log::Level::Trace)
- .with_min_level(log::Level::Error);
-
- assert_eq!(config.log_level, Some(log::LevelFilter::Error));
- }
-
- #[test]
fn test_with_max_level() {
let config = Config::default()
.with_max_level(log::LevelFilter::Trace)
diff --git a/rust/tests/config_log_level_deprecated.rs b/rust/tests/config_log_level_deprecated.rs
deleted file mode 100644
index 8efd5c5..0000000
--- a/rust/tests/config_log_level_deprecated.rs
+++ /dev/null
@@ -1,23 +0,0 @@
-//! This is the old version of `config_log_level.rs` that uses the deprecated
-//! `with_min_level` method. The test should be deleted when `with_min_level` is
-//! fully removed.
-//!
-//! Do not put multiple tests in this file. Tests in the same file run in the
-//! same executable, so if there are several tests in one file, only one test
-//! will successfully be able to initialize the logger.
-
-use std::env;
-
-#[test]
-fn config_log_min_level() {
- // Environment variables should be overwritten by config values.
- env::set_var("RUST_LOG", "debug");
-
- let init_result = logger::init(logger::Config::default().with_min_level(log::Level::Trace));
-
- assert!(init_result);
- // Setting the level through the Config struct should impact both host and device
- assert_eq!(log::max_level(), log::LevelFilter::Trace);
-
- env::remove_var("RUST_LOG");
-}