mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-07 20:39:04 +03:00
Use env_logger
instead of simplelog
in tests
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
37444acc9c
commit
ddd746b9f9
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -993,6 +993,7 @@ dependencies = [
|
||||
"core-graphics",
|
||||
"core-text",
|
||||
"ctor",
|
||||
"env_logger",
|
||||
"etagere",
|
||||
"font-kit",
|
||||
"foreign-types",
|
||||
@ -2453,6 +2454,7 @@ dependencies = [
|
||||
"ctor",
|
||||
"dirs",
|
||||
"easy-parallel",
|
||||
"env_logger",
|
||||
"fsevent",
|
||||
"futures-core",
|
||||
"gpui",
|
||||
|
@ -34,6 +34,7 @@ bindgen = "0.57"
|
||||
cc = "1.0.67"
|
||||
|
||||
[dev-dependencies]
|
||||
env_logger = "0.8"
|
||||
png = "0.16"
|
||||
simplelog = "0.9"
|
||||
|
||||
|
@ -1,8 +1,6 @@
|
||||
use ctor::ctor;
|
||||
use simplelog::SimpleLogger;
|
||||
use log::LevelFilter;
|
||||
|
||||
#[ctor]
|
||||
fn init_logger() {
|
||||
SimpleLogger::init(LevelFilter::Info, Default::default()).expect("could not initialize logger");
|
||||
env_logger::init();
|
||||
}
|
||||
|
@ -38,6 +38,7 @@ smallvec = "1.6.1"
|
||||
smol = "1.2.5"
|
||||
|
||||
[dev-dependencies]
|
||||
env_logger = "0.8"
|
||||
serde_json = {version = "1.0.64", features = ["preserve_order"]}
|
||||
tempdir = "0.3.7"
|
||||
unindent = "0.1.7"
|
||||
|
@ -1,8 +1,6 @@
|
||||
use crate::time::ReplicaId;
|
||||
use ctor::ctor;
|
||||
use log::LevelFilter;
|
||||
use rand::Rng;
|
||||
use simplelog::SimpleLogger;
|
||||
use std::{
|
||||
collections::BTreeMap,
|
||||
path::{Path, PathBuf},
|
||||
@ -11,7 +9,7 @@ use tempdir::TempDir;
|
||||
|
||||
#[ctor]
|
||||
fn init_logger() {
|
||||
SimpleLogger::init(LevelFilter::Info, Default::default()).expect("could not initialize logger");
|
||||
env_logger::init();
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
|
@ -888,10 +888,8 @@ mod tests {
|
||||
use crate::test::*;
|
||||
use anyhow::Result;
|
||||
use gpui::App;
|
||||
use log::LevelFilter;
|
||||
use rand::prelude::*;
|
||||
use serde_json::json;
|
||||
use simplelog::SimpleLogger;
|
||||
use std::env;
|
||||
use std::os::unix;
|
||||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
@ -1028,8 +1026,6 @@ mod tests {
|
||||
.map(|o| o.parse().unwrap())
|
||||
.unwrap_or(20);
|
||||
let seeds = if let Ok(seed) = env::var("SEED").map(|s| s.parse().unwrap()) {
|
||||
// Init logging so that we can debug the operations for this seed.
|
||||
SimpleLogger::init(LevelFilter::Info, Default::default()).unwrap();
|
||||
seed..seed + 1
|
||||
} else {
|
||||
0..iterations
|
||||
|
Loading…
Reference in New Issue
Block a user