Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore:(logging): improve debug logs with -vv #8867

Merged
merged 5 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions crates/turborepo-lib/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ use turbopath::AbsoluteSystemPathBuf;
use turborepo_api_client::AnonAPIClient;
use turborepo_repository::inference::{RepoMode, RepoState};
use turborepo_telemetry::{
events::{
command::{CodePath, CommandEventBuilder},
generic::GenericEventBuilder,
EventBuilder, EventType,
},
events::{command::CommandEventBuilder, generic::GenericEventBuilder, EventBuilder, EventType},
init_telemetry, track_usage, TelemetryHandle,
};
use turborepo_ui::{GREY, UI};
Expand Down
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
Loading