Skip to content

Commit

Permalink
feat: Remove Running Firecracker start-up log
Browse files Browse the repository at this point in the history
There is no clear value in the log and it introduces additional complexity.

Signed-off-by: Jonathan Woollett-Light <[email protected]>
  • Loading branch information
Jonathan Woollett-Light committed Sep 1, 2023
1 parent b859e50 commit d6a279f
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 22 deletions.
1 change: 0 additions & 1 deletion src/firecracker/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ fn main() -> ExitCode {
fn main_exec() -> Result<(), MainError> {
// Initialize the logger.
LOGGER.init().map_err(MainError::SetLogger)?;
info!("Running Firecracker v{FIRECRACKER_VERSION}");

register_signal_handlers().map_err(MainError::RegisterSignalHandlers)?;

Expand Down
1 change: 0 additions & 1 deletion src/logger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name = "logger"
version = "0.1.0"
authors = ["Amazon Firecracker team <[email protected]>"]
edition = "2021"
build = "../../build.rs"
license = "Apache-2.0"

[lib]
Expand Down
9 changes: 0 additions & 9 deletions src/logger/src/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ const DEFAULT_LEVEL: log::LevelFilter = log::LevelFilter::Info;
pub const DEFAULT_INSTANCE_ID: &str = "anonymous-instance";
/// Instance id.
pub static INSTANCE_ID: OnceLock<String> = OnceLock::new();
/// Semver version of Firecracker.
const FIRECRACKER_VERSION: &str = env!("FIRECRACKER_VERSION");

/// The logger.
///
Expand Down Expand Up @@ -96,13 +94,6 @@ impl Logger {
guard.filter.module = Some(module);
}

// Ensure we drop the guard before attempting to log, otherwise this
// would deadlock.
drop(guard);
if target_changed {
log::info!("Running Firecracker v{FIRECRACKER_VERSION}");
}

Ok(())
}
}
Expand Down
6 changes: 1 addition & 5 deletions tests/framework/microvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,7 @@ def _validate_api_response_times(self):
def firecracker_version(self):
"""Return the version of the Firecracker executable."""
_, stdout, _ = utils.run_cmd(f"{self._fc_binary_path} --version")
# The 1st line will be `Running Firecracker vX.Y.Z`
# The 2nd line will be the output from `--version`.
line = stdout.split("\n")[1]
line = stdout.partition("\n")[0]
result = re.match(r"^Firecracker v(.+)", line)
return result.group(1)

Expand Down Expand Up @@ -504,8 +502,6 @@ def spawn(
# and leave 0.2 delay between them.
if "no-api" not in self.jailer.extra_args:
self._wait_create()
if self.log_file and log_level in ("Trace", "Debug", "Info"):
self.check_log_message("Running Firecracker")

@retry(delay=0.2, tries=5)
def _wait_create(self):
Expand Down
6 changes: 0 additions & 6 deletions tests/integration_tests/functional/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,6 @@ def _test_log_config(microvm, log_level="Info", show_level=True, show_origin=Tru

lines = microvm.log_data.splitlines()

# Check for `Running Firecracker` message.
configured_level_no = LOG_LEVELS.index(to_formal_log_level(log_level))
info_level_no = LOG_LEVELS.index("INFO")
if info_level_no <= configured_level_no:
assert "Running Firecracker" in lines[0]

# Check format of messages
for line in lines:
check_log_message_format(line, microvm.id, log_level, show_level, show_origin)

0 comments on commit d6a279f

Please sign in to comment.