这是indexloc提供的服务,不要输入任何密码
Skip to content

swap out log for tracing and add the TurboFormatter #4694

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

Merged
merged 5 commits into from
Apr 27, 2023
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
75 changes: 16 additions & 59 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ indicatif = "0.17.3"
indoc = "2.0.0"
itertools = "0.10.5"
lazy_static = "1.4.0"
log = "0.4.17"
mime = "0.3.16"
nohash-hasher = "0.2.0"
once_cell = "1.17.1"
Expand Down
5 changes: 3 additions & 2 deletions crates/turborepo-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ dialoguer = { workspace = true, features = ["fuzzy-select"] }
directories = "4.0.1"
dirs-next = "2.0.0"
dunce = { workspace = true }
env_logger = "0.10.0"
futures = "0.3.26"
glob-match = "0.2.1"
globwatch = { path = "../globwatch" }
Expand All @@ -56,7 +55,6 @@ indicatif = { workspace = true }
itertools = "0.10.5"
lazy_static = { workspace = true }
libc = "0.2.140"
log = { workspace = true }
notify = { version = "5.1.0", default-features = false, features = [
"macos_kqueue",
] }
Expand Down Expand Up @@ -84,6 +82,9 @@ url = "2.3.1"

const_format = "0.2.30"
go-parse-duration = "0.1.1"
is-terminal = "0.4.7"
owo-colors.workspace = true
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
tracing.workspace = true
turbo-updater = { workspace = true }
turbopath = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use anyhow::{anyhow, Result};
use clap::{ArgAction, CommandFactory, Parser, Subcommand, ValueEnum};
use clap_complete::{generate, Shell};
use dunce::canonicalize as fs_canonicalize;
use log::{debug, error};
use serde::Serialize;
use tracing::{debug, error};

use crate::{
commands::{bin, daemon, link, login, logout, unlink, CommandBase},
Expand Down
6 changes: 3 additions & 3 deletions crates/turborepo-lib/src/commands/login.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ use std::sync::Arc;
use anyhow::{anyhow, Context, Result};
#[cfg(not(test))]
use axum::{extract::Query, response::Redirect, routing::get, Router};
use log::debug;
#[cfg(not(test))]
use log::warn;
use reqwest::Url;
use serde::Deserialize;
use tokio::sync::OnceCell;
use tracing::debug;
#[cfg(not(test))]
use tracing::warn;

use crate::{
commands::{
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-lib/src/commands/logout.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::Result;
use log::error;
use tracing::error;

use crate::{commands::CommandBase, ui::GREY};

Expand Down
3 changes: 2 additions & 1 deletion crates/turborepo-lib/src/daemon/client.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use thiserror::Error;
use tonic::{Code, Status};
use tracing::info;

use self::proto::turbod_client::TurbodClient;
use super::connector::{DaemonConnector, DaemonConnectorError};
Expand Down Expand Up @@ -33,7 +34,7 @@ impl<T> DaemonClient<T> {
/// Stops the daemon and closes the connection, returning
/// the connection settings that were used to connect.
pub async fn stop(mut self) -> Result<T, DaemonError> {
log::info!("Stopping daemon");
info!("Stopping daemon");
self.client.shutdown(proto::ShutdownRequest {}).await?;
Ok(self.connect_settings)
}
Expand Down
5 changes: 3 additions & 2 deletions crates/turborepo-lib/src/daemon/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ use std::{
};

use command_group::AsyncCommandGroup;
use log::{debug, error};
use notify::{Config, Event, EventKind, Watcher};
use sysinfo::{Pid, ProcessExt, ProcessRefreshKind, RefreshKind, SystemExt};
use thiserror::Error;
use tokio::{sync::mpsc, time::timeout};
use tonic::transport::Endpoint;
use tracing::debug;

use super::{client::proto::turbod_client::TurbodClient, DaemonClient};
use crate::daemon::DaemonError;
Expand Down Expand Up @@ -381,6 +381,7 @@ mod test {
select,
sync::{oneshot::Sender, Mutex},
};
use tracing::info;
use turbopath::AbsoluteSystemPathBuf;

use super::*;
Expand Down Expand Up @@ -568,7 +569,7 @@ mod test {
&self,
req: tonic::Request<proto::ShutdownRequest>,
) -> tonic::Result<tonic::Response<proto::ShutdownResponse>> {
log::info!("shutdown request: {:?}", req);
info!("shutdown request: {:?}", req);
self.shutdown
.lock()
.await
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-lib/src/daemon/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ use std::{
};

use futures::Stream;
use log::debug;
use tokio::io::{AsyncRead, AsyncWrite};
use tonic::transport::server::Connected;
use tracing::debug;
use turbopath::{AbsoluteSystemPathBuf, RelativeSystemPathBuf};

#[derive(thiserror::Error, Debug)]
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-lib/src/daemon/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ use std::{
};

use globwatch::{StopSource, Watcher};
use log::error;
use tokio::{
select,
signal::ctrl_c,
Expand All @@ -33,6 +32,7 @@ use tokio::{
};
use tonic::transport::{NamedService, Server};
use tower::ServiceBuilder;
use tracing::error;
use turbopath::{AbsoluteSystemPathBuf, RelativeSystemPathBuf};

use super::{
Expand Down
Loading