Skip to content

Commit

Permalink
chore:(logging): improve debug logs with -vv (#8867)
Browse files Browse the repository at this point in the history
  • Loading branch information
mehulkar authored Jul 30, 2024
1 parent 34c9a58 commit 5c11459
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
4 changes: 3 additions & 1 deletion crates/turborepo-lib/src/engine/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ impl Engine {

if let Err(StopExecution) = result.await.unwrap_or_else(|_| {
// If the visitor doesn't send a callback, then we assume the task finished
debug!("Engine visitor dropped callback sender without sending result");
tracing::trace!(
"Engine visitor dropped callback sender without sending result"
);
Ok(())
}) {
if walker
Expand Down
14 changes: 8 additions & 6 deletions crates/turborepo-lib/src/task_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,14 @@ impl<'a> TaskHasher<'a> {
let external_deps_hash =
is_monorepo.then(|| get_external_deps_hash(&workspace.transitive_dependencies));

debug!(
"task hash env vars for {}:{}\n vars: {:?}",
task_id.package(),
task_id.task(),
hashable_env_pairs
);
if !hashable_env_pairs.is_empty() {
debug!(
"task hash env vars for {}:{}\n vars: {:?}",
task_id.package(),
task_id.task(),
hashable_env_pairs
);
}

let package_dir = workspace.package_path().to_unix();
let is_root_package = package_dir.is_empty();
Expand Down
12 changes: 6 additions & 6 deletions crates/turborepo-telemetry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use tokio::{
sync::{mpsc, oneshot},
task::{JoinError, JoinHandle},
};
use tracing::{debug, error};
use tracing::{debug, error, trace};
use turborepo_api_client::telemetry;
use turborepo_ui::{color, BOLD, GREY, UI};
use uuid::Uuid;
Expand Down Expand Up @@ -203,15 +203,15 @@ impl<C: telemetry::TelemetryClient + Clone + Send + Sync + 'static> Worker<C> {
pub fn flush_events(&mut self) {
if !self.buffer.is_empty() {
let events = std::mem::take(&mut self.buffer);
debug!(
"Starting telemetry event queue flush (num_events={:?})",
events.len()
);
let num_events = events.len();
let handle = self.send_events(events);
if let Some(handle) = handle {
self.senders.push(handle);
}
debug!("Done telemetry event queue flush");
trace!(
"Flushed telemetry event queue (num_events={:?})",
num_events
);
}
}

Expand Down

0 comments on commit 5c11459

Please sign in to comment.