Return the effective log level for a sandbox. Uses the level from the sandbox spec when non-empty, falling back to `default_level` otherwise.
(sandbox: &DriverSandbox, default_level: &str)
| 117 | /// Uses the level from the sandbox spec when non-empty, falling back to |
| 118 | /// `default_level` otherwise. |
| 119 | pub fn sandbox_log_level(sandbox: &DriverSandbox, default_level: &str) -> String { |
| 120 | sandbox |
| 121 | .spec |
| 122 | .as_ref() |
| 123 | .map(|spec| spec.log_level.as_str()) |
| 124 | .filter(|level| !level.is_empty()) |
| 125 | .unwrap_or(default_level) |
| 126 | .to_string() |
| 127 | } |
| 128 | |
| 129 | // --------------------------------------------------------------------------- |
| 130 | // Supervisor image helpers (shared by Docker and Podman drivers) |
no test coverage detected