refactor(watch): add more logging

This commit is contained in:
Harsh Shandilya 2022-08-18 00:42:24 +05:30
parent dfe2ddaa3d
commit 65aa4c0c75
No known key found for this signature in database
GPG Key ID: 366D7BBAD1031E80
1 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,6 @@
use anyhow::{Context, Result};
use serde::Deserialize;
use tracing::trace;
use tracing::{debug, trace};
use watchman_client::{prelude::*, Subscription};
use crate::config::Bucket;
@ -19,13 +19,17 @@ pub async fn generate_subscriptions<'a>(
bucket: &'a Bucket<'_>,
) -> Result<Vec<Subscription<NameAndType>>> {
if let Some(name) = bucket.name {
trace!("Generating Watchman subscription for {}", name);
trace!("Generating Watchman subscriptions for {}", name);
}
let mut subs = vec![];
for path in &bucket.sources {
let resolved = client
.resolve_root(CanonicalPath::canonicalize(path).context(format!("{}", path.display()))?)
.await?;
debug!(
"Adding subscription for {}",
resolved.path().as_path().display()
);
let (sub, _) = client
.subscribe::<NameAndType>(&resolved, SubscribeRequest::default())
.await?;