zlog: Replace usages of env_logger in tests with zlog (#31436)

Also fixes:
https://github.com/zed-industries/zed/pull/31400#issuecomment-2908165249

Release Notes:

- N/A *or* Added/Fixed/Improved ...
This commit is contained in:
Ben Kunkle 2025-05-26 10:48:50 -05:00 committed by GitHub
parent 0c27aaecb3
commit c0aa8f63fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
66 changed files with 123 additions and 167 deletions

View file

@ -95,7 +95,6 @@ dap = { workspace = true, features = ["test-support"] }
dap_adapters = { workspace = true, features = ["test-support"] }
debugger_ui = { workspace = true, features = ["test-support"] }
editor = { workspace = true, features = ["test-support"] }
env_logger.workspace = true
extension.workspace = true
file_finder.workspace = true
fs = { workspace = true, features = ["test-support"] }
@ -133,6 +132,7 @@ unindent.workspace = true
util.workspace = true
workspace = { workspace = true, features = ["test-support"] }
worktree = { workspace = true, features = ["test-support"] }
zlog.workspace = true
[package.metadata.cargo-machete]
ignored = ["async-stripe"]

View file

@ -18,9 +18,7 @@ use workspace::{Workspace, dock::Panel};
use super::{TestClient, TestServer};
pub fn init_test(cx: &mut gpui::TestAppContext) {
if std::env::var("RUST_LOG").is_ok() {
env_logger::try_init().ok();
}
zlog::init_test();
cx.update(|cx| {
theme::init(theme::LoadThemes::JustBase, cx);

View file

@ -56,9 +56,7 @@ use workspace::Pane;
#[ctor::ctor]
fn init_logger() {
if std::env::var("RUST_LOG").is_ok() {
env_logger::init();
}
zlog::init_test();
}
#[gpui::test(iterations = 10)]

View file

@ -589,9 +589,7 @@ async fn test_remote_server_debugger(
cx_a.update(|cx| {
release_channel::init(SemanticVersion::default(), cx);
command_palette_hooks::init(cx);
if std::env::var("RUST_LOG").is_ok() {
env_logger::try_init().ok();
}
zlog::init_test();
dap_adapters::init(cx);
});
server_cx.update(|cx| {