Skip to content

Commit

Permalink
Set RUST_LOG=info as a default (#23925)
Browse files Browse the repository at this point in the history
Set for all executables, rather than specifically for local-backend

GitOrigin-RevId: c0754eeabcedd72b6eb13dc271a132ee1c31d721
  • Loading branch information
nipunn1313 authored and Convex, Inc. committed Mar 25, 2024
1 parent b0e9358 commit 191261b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set positional-arguments

# (*) Run the open source convex backend on port 3210
run-local-backend *ARGS:
RUST_LOG=${RUST_LOG:-info} cargo run -p local_backend --bin convex-local-backend -- "$@"
cargo run -p local_backend --bin convex-local-backend -- "$@"

# Uses an admin key from admin_key.txt for dev backends.
# This uses the default admin key for local backends, which is safe as long as the backend is
Expand Down
4 changes: 3 additions & 1 deletion crates/cmd_util/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ pub fn config_tool() -> TracingGuard {
.boxed(),
};
let stdout = format_layer
.with_filter(tracing_subscriber::EnvFilter::from_default_env())
.with_filter(
tracing_subscriber::EnvFilter::try_from_default_env().unwrap_or(EnvFilter::new("info")),
)
.boxed();
layers.push(stdout);

Expand Down
3 changes: 0 additions & 3 deletions crates/local_backend/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ use tokio::signal::{
};

fn main() -> Result<(), MainError> {
if std::env::var_os("RUST_LOG").is_none() {
std::env::set_var("RUST_LOG", "info");
}
tracing::info!("Starting a local backend");
let _guard = config_tool();
let config = LocalConfig::parse();
Expand Down

0 comments on commit 191261b

Please sign in to comment.