summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2019-06-25 11:44:57 -0300
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2019-06-25 11:44:57 -0300
commit8c2a729fd5c64b47f34eee3e4558d363f3aab8d3 (patch)
tree549c5a12ccc29dc9017660a7ef88b2a3db12c490
parent58590ea31af530bca88b155d33aedc5d53a8b9c7 (diff)
parent7f6eb7d0d506e2055bc789a08693c6f8cb0b70f0 (diff)
downloadmullvadvpn-8c2a729fd5c64b47f34eee3e4558d363f3aab8d3.tar.xz
mullvadvpn-8c2a729fd5c64b47f34eee3e4558d363f3aab8d3.zip
Merge branch 'include-logcat-in-problem-report'
-rw-r--r--Cargo.lock1
-rw-r--r--mullvad-problem-report/Cargo.toml4
-rw-r--r--mullvad-problem-report/src/lib.rs16
3 files changed, 21 insertions, 0 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 5aab93823a..f98147de1c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1196,6 +1196,7 @@ version = "2019.5.0"
dependencies = [
"clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
"dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "duct 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"err-derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
diff --git a/mullvad-problem-report/Cargo.toml b/mullvad-problem-report/Cargo.toml
index b62350797b..30748fdde2 100644
--- a/mullvad-problem-report/Cargo.toml
+++ b/mullvad-problem-report/Cargo.toml
@@ -32,6 +32,10 @@ mullvad-rpc = { path = "../mullvad-rpc" }
talpid-types = { path = "../talpid-types" }
+[target.'cfg(target_os = "android")'.dependencies]
+duct = "0.12"
+
+
[target.'cfg(target_os = "linux")'.dependencies]
rs-release = { git = "https://github.com/mullvad/rs-release", branch = "snailquote-unescape" }
diff --git a/mullvad-problem-report/src/lib.rs b/mullvad-problem-report/src/lib.rs
index 4fa42413fa..d18467c069 100644
--- a/mullvad-problem-report/src/lib.rs
+++ b/mullvad-problem-report/src/lib.rs
@@ -151,6 +151,11 @@ pub fn collect_report(
}
None => {}
}
+ #[cfg(target_os = "android")]
+ match write_logcat_to_file() {
+ Ok(logcat_path) => problem_report.add_log(&logcat_path),
+ Err(error) => problem_report.add_error("Failed to collect logcat", &error),
+ }
problem_report.add_logs(extra_logs);
@@ -229,6 +234,17 @@ fn is_tunnel_log(path: &Path) -> bool {
}
}
+#[cfg(target_os = "android")]
+fn write_logcat_to_file() -> Result<PathBuf, io::Error> {
+ let logcat_path = PathBuf::from("/data/data/net.mullvad.mullvadvpn/logcat.txt");
+
+ duct::cmd!("logcat", "-d")
+ .stderr_to_stdout()
+ .stdout(&logcat_path)
+ .run()
+ .map(|_| logcat_path)
+}
+
pub fn send_problem_report(
user_email: &str,
user_message: &str,