Skip to content

Commit

Permalink
Merge pull request #1073 from AmbientRun/fix-log-levels
Browse files Browse the repository at this point in the history
Fix misuse of overly verbose log levels and unify use of log and tracing
  • Loading branch information
ten3roberts authored Oct 12, 2023
2 parents c2e64af + 76def02 commit fa39ecd
Show file tree
Hide file tree
Showing 109 changed files with 365 additions and 459 deletions.
53 changes: 14 additions & 39 deletions Cargo.lock

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

6 changes: 2 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@ rust-version = "1.70.0"
aho-corasick = "1.1.1"
profiling = { version = "1.0.11", features = ["profile-with-puffin"] }
tracing = "0.1.37"
tracing-tree = { version = "0.2" }
tracing-tree = { version = "0.2", features = ["time"] }
tracing-stackdriver = "0.6.2"
tracing-subscriber = { version = "0.3.17", features = [
"env-filter",
"time",
"local-time",
"parking_lot",
] }
tracing-log = { version = "0.1" }
wgpu = { version = "0.16.3", features = ["serde", "trace", "replay"] }
wgpu-types = { version = "0.16", features = ["serde"] }
winit = { version = "0.28.6", features = ["serde"] }
Expand All @@ -38,7 +37,6 @@ ndarray = { version = "0.15.6", features = ["serde"] }
rand = "0.8.5"
rand_pcg = "0.3.1"
glyph_brush = "0.7.7"
log = "0.4"
dyn-clonable = "0.9.0"
semver = { version = "1.0", features = ["serde"] }
paste = "1.0"
Expand Down Expand Up @@ -177,7 +175,7 @@ wasm-bindgen-futures = "0.4"
#
# Networking
#
time = { version = "0.3" }
time = { version = "0.3", features = ["local-offset"] }
quinn = { version = "0.10" }
rustls-native-certs = "0.6.3"
webpki-roots = "0.23.1"
Expand Down
7 changes: 2 additions & 5 deletions app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,13 @@ ambient_shared_types = { path = "../shared_crates/shared_types", features = [

tracing-tree = { workspace = true, optional = true }
tracing-stackdriver = { workspace = true, optional = true }
tracing-subscriber = { workspace = true, optional = true }
tracing-log = { workspace = true, optional = true }
tracing-subscriber = { workspace = true }
time = { workspace = true }
anyhow = { workspace = true }
clap = { workspace = true }
convert_case = { workspace = true }
env_logger = { workspace = true }
glam = { workspace = true }
log = { workspace = true }
parking_lot = { workspace = true }
rustls-pemfile = { workspace = true }
serde = { workspace = true }
Expand All @@ -80,8 +78,7 @@ slim = ["stackdriver"]
production = ["assimp"]
profile = ["ambient_app/profile"]
assimp = ["ambient_model_import/russimp"]
stackdriver = ["tracing", "tracing-stackdriver"]
tracing = ["tracing-tree", "tracing-subscriber", "tracing-log"]
stackdriver = ["tracing-stackdriver"]
tls-native-roots = ["ambient_network/tls-native-roots"]
tls-webpki-roots = ["ambient_network/tls-webpki-roots"]
hotload-includes = [
Expand Down
14 changes: 7 additions & 7 deletions app/src/cli/package/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub async fn handle(args: &Deploy, assets: &AssetCache, release_build: bool) ->
if !release_build {
// Using string interpolation due to a rustfmt bug where it will break
// if any one line is too long
log::warn!(
tracing::warn!(
"{} {}",
"Deploying a debug build which might involve uploading large files.",
"Remove `--debug` to deploy a release build."
Expand Down Expand Up @@ -218,7 +218,7 @@ pub async fn handle(args: &Deploy, assets: &AssetCache, release_build: bool) ->

match deployment_id {
Deployment::Skipped => {
log::info!(
tracing::info!(
"Package \"{main_package_name}\" was already deployed, skipping deployment"
);
}
Expand All @@ -238,10 +238,10 @@ pub async fn handle(args: &Deploy, assets: &AssetCache, release_build: bool) ->
Some(&deployment_id),
);

log::info!("Package \"{main_package_name}\" deployed successfully!");
log::info!(" Deployment ID: {deployment_id}");
log::info!(" Join: ambient join '{ensure_running_url}'");
log::info!(" Web URL: '{}'", web_url.bright_green());
tracing::info!("Package \"{main_package_name}\" deployed successfully!");
tracing::info!(" Deployment ID: {deployment_id}");
tracing::info!(" Join: ambient join '{ensure_running_url}'");
tracing::info!(" Web URL: '{}'", web_url.bright_green());

if first_deployment_id.is_none() {
first_deployment_id = Some(deployment_id);
Expand All @@ -256,7 +256,7 @@ pub async fn handle(args: &Deploy, assets: &AssetCache, release_build: bool) ->
let server =
ambient_cloud_client::ensure_server_running(assets, api_server, token.into(), spec)
.await?;
log::info!("Deployed package is running at {}", server.host);
tracing::info!("Deployed package is running at {}", server.host);
}

Ok(())
Expand Down
Loading

0 comments on commit fa39ecd

Please sign in to comment.