refactor: add the log plugin

This commit is contained in:
Kevin Yue
2023-05-23 16:38:29 +08:00
parent 462428f99a
commit 8de183a53d
6 changed files with 304 additions and 149 deletions

View File

@@ -26,12 +26,6 @@ struct StatusHolder {
impl Default for StatusHolder {
fn default() -> Self {
Self::new()
}
}
impl StatusHolder {
fn new() -> Self {
let (status_tx, status_rx) = watch::channel(VpnStatus::Disconnected);
Self {
@@ -40,7 +34,9 @@ impl StatusHolder {
status_rx,
}
}
}
impl StatusHolder {
fn set(&mut self, status: VpnStatus) {
self.status = status;
if let Err(err) = self.status_tx.send(status) {