Skip to content

pretty print panics #854

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
## Unreleased

### Added

- Documentation for development environment setup on AWS.

### Changed

- Pretty print panic information.

### Fixed

## [0.13.0]
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fn main() {
// We're currently using the closure parameter, which is a &PanicInfo, for printing the
// origin of the panic, including the payload passed to panic! and the source code location
// from which the panic originated.
error!("Panic occurred: {:?}", info);
error!("Firecracker {}", info);
METRICS.vmm.panic_count.inc();
let bt = Backtrace::new();
error!("{:?}", bt);
Expand Down Expand Up @@ -240,7 +240,7 @@ mod tests {
log_file.as_str(),
&[
// Lines containing these words should have appeared in the log, in this order
("ERROR", "main.rs", "Panic occurred"),
("ERROR", "main.rs", "Firecracker panicked at"),
("ERROR", "main.rs", "stack backtrace:"),
("0:", "0x", "firecracker::main::"),
],
Expand Down