mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-17 14:58:16 +00:00
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 <liang3.ma@intel.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user