From a989686cf677a7bf947ad8c2827fd5f40c812af1 Mon Sep 17 00:00:00 2001 From: "Liang, Ma" Date: Wed, 10 Sep 2025 15:38:06 +0800 Subject: [PATCH] kata-agent: Rename misleading variable in config parsing The variable `addr` was used to store the log level string read from the `LOG_LEVEL_ENV_VAR` environment variable. This name is misleading as it implies a network address rather than a log level value. This commit renames the variable to `level` to more accurately reflect its purpose, improving the overall readability of the configuration code. A minor whitespace formatting fix in a macro is also included. Signed-off-by: Liang, Ma --- src/agent/src/config.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/agent/src/config.rs b/src/agent/src/config.rs index 08541f5047..baf5b05e67 100644 --- a/src/agent/src/config.rs +++ b/src/agent/src/config.rs @@ -202,7 +202,7 @@ macro_rules! config_override { } }; - ($builder:ident, $config:ident, $field:ident, $func: ident) => { + ($builder:ident, $config:ident, $field:ident, $func:ident) => { if let Some(v) = $builder.$field { $config.$field = $func(&v)?; } @@ -661,8 +661,8 @@ impl AgentConfig { self.server_addr = addr; } - if let Ok(addr) = env::var(LOG_LEVEL_ENV_VAR) { - if let Ok(level) = logrus_to_slog_level(&addr) { + if let Ok(level) = env::var(LOG_LEVEL_ENV_VAR) { + if let Ok(level) = logrus_to_slog_level(&level) { self.log_level = level; } }