diff options
| author | Emīls <emils@mullvad.net> | 2022-02-14 18:28:16 +0000 |
|---|---|---|
| committer | Emīls <emils@mullvad.net> | 2022-02-15 15:21:01 +0000 |
| commit | 962e8c69d89ff2a59b34ae5054107466b85cbfd8 (patch) | |
| tree | 4fd7d5993afb0e57f9e9fac0cafac40dc78492f5 | |
| parent | 4f1cf5b6a032de6715c026995cc1818acb69d579 (diff) | |
| download | mullvadvpn-962e8c69d89ff2a59b34ae5054107466b85cbfd8.tar.xz mullvadvpn-962e8c69d89ff2a59b34ae5054107466b85cbfd8.zip | |
Log API availability state transitions
| -rw-r--r-- | mullvad-rpc/src/availability.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mullvad-rpc/src/availability.rs b/mullvad-rpc/src/availability.rs index 67eccc3a72..da8d624e80 100644 --- a/mullvad-rpc/src/availability.rs +++ b/mullvad-rpc/src/availability.rs @@ -66,6 +66,7 @@ pub struct ApiAvailabilityHandle { impl ApiAvailabilityHandle { pub fn suspend(&self) { + log::debug!("Suspending API requests"); let mut state = self.state.lock().unwrap(); if !state.suspended { state.suspended = true; @@ -74,6 +75,7 @@ impl ApiAvailabilityHandle { } pub fn unsuspend(&self) { + log::debug!("Unsuspending API requests"); let mut state = self.state.lock().unwrap(); if state.suspended { state.suspended = false; @@ -82,6 +84,7 @@ impl ApiAvailabilityHandle { } pub fn pause_background(&self) { + log::debug!("Pausing background API requests"); let mut state = self.state.lock().unwrap(); if !state.pause_background { state.pause_background = true; @@ -90,6 +93,7 @@ impl ApiAvailabilityHandle { } pub fn resume_background(&self) { + log::debug!("Resuming background API requests"); let mut state = self.state.lock().unwrap(); if state.pause_background { state.pause_background = false; @@ -98,6 +102,11 @@ impl ApiAvailabilityHandle { } pub fn set_offline(&self, offline: bool) { + if offline { + log::debug!("Pausing API requests due to being offline"); + } else { + log::debug!("Resuming API requests due to coming online"); + } let mut state = self.state.lock().unwrap(); if state.offline != offline { state.offline = offline; |
