Adding backtrace off option for fuchsia targets
This commit is contained in:
parent
78a891d364
commit
88baf8f6f5
1 changed files with 16 additions and 17 deletions
|
@ -295,23 +295,22 @@ pub fn get_backtrace_style() -> Option<BacktraceStyle> {
|
||||||
return Some(style);
|
return Some(style);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setting environment variables for Fuchsia components isn't a standard
|
let format = crate::env::var_os("RUST_BACKTRACE")
|
||||||
// or easily supported workflow. For now, display backtraces by default.
|
.map(|x| {
|
||||||
let format = if cfg!(target_os = "fuchsia") {
|
if &x == "0" {
|
||||||
BacktraceStyle::Full
|
BacktraceStyle::Off
|
||||||
} else {
|
} else if &x == "full" {
|
||||||
crate::env::var_os("RUST_BACKTRACE")
|
BacktraceStyle::Full
|
||||||
.map(|x| {
|
} else {
|
||||||
if &x == "0" {
|
BacktraceStyle::Short
|
||||||
BacktraceStyle::Off
|
}
|
||||||
} else if &x == "full" {
|
})
|
||||||
BacktraceStyle::Full
|
.unwrap_or(if cfg!(target_os = "fuchsia") {
|
||||||
} else {
|
// Fuchsia components default to full backtrace.
|
||||||
BacktraceStyle::Short
|
BacktraceStyle::Full
|
||||||
}
|
} else {
|
||||||
})
|
BacktraceStyle::Off
|
||||||
.unwrap_or(BacktraceStyle::Off)
|
});
|
||||||
};
|
|
||||||
set_backtrace_style(format);
|
set_backtrace_style(format);
|
||||||
Some(format)
|
Some(format)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue