mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-24 11:36:31 +00:00
fix: mark unsafety of std::env::set_var
and document the function.
This commit is contained in:
@@ -388,9 +388,12 @@ impl Filter {
|
||||
}
|
||||
}
|
||||
|
||||
/// # Safety
|
||||
///
|
||||
/// initialize `RUST_LOG` env var before start tokio runtime to limit multithread problem with `std::env::set_var` which is unsafe
|
||||
fn main() -> Result<(), Error> {
|
||||
if std::env::var("RUST_LOG").is_err() {
|
||||
std::env::set_var("RUST_LOG", "warn")
|
||||
unsafe { std::env::set_var("RUST_LOG", "warn") };
|
||||
}
|
||||
|
||||
tracing_subscriber::fmt()
|
||||
|
||||
Reference in New Issue
Block a user