Skip to content

Commit

Permalink
chore: replace logging with tracing crate
Browse files Browse the repository at this point in the history
  • Loading branch information
rholshausen committed May 9, 2022
1 parent f2e4c3f commit e194ab9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 23 deletions.
29 changes: 13 additions & 16 deletions drivers/rust/Cargo.lock

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

6 changes: 3 additions & 3 deletions drivers/rust/driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ anyhow = "1.0.57"
lazy_static = "1.4.0"
maplit = "1.0.2"
home = "0.5.3"
log = "=0.4.14" # This needs to be the same version across all the pact libs (i.e. pact ffi)
tonic = "0.6.2"
prost = "0.9.0"
prost-types = "0.9.0"
tokio = { version = "1.18.1", features = ["full"] }
sysinfo = "0.21.2"
itertools = "0.10.3"
pact_models = "0.4.0"
pact_models = "0.4.1"
regex = "1.5.5"
bytes = "1.1.0"
uuid = { version = "0.8.2", features = ["v4"] }
async-trait = "0.1.53"
os_info = "3.3.0"
md5 = "0.7.0"
semver = "1.0.9"
tracing = { version = "0.1", features = [ "log-always" ] }
tracing = "0.1.34"
tracing-core = "0.1.26"

[dependencies.reqwest]
version = "0.11.10"
Expand Down
8 changes: 4 additions & 4 deletions drivers/rust/driver/src/plugin_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use anyhow::anyhow;
use bytes::Bytes;
use itertools::Either;
use lazy_static::lazy_static;
use log::max_level;
use os_info::Type;
use pact_models::bodies::OptionalBody;
use pact_models::PactSpecification;
Expand All @@ -26,6 +25,7 @@ use serde_json::Value;
use sysinfo::{Pid, ProcessExt, RefreshKind, Signal, System, SystemExt};
use tokio::process::Command;
use tracing::{debug, trace, warn};
use tracing_core::LevelFilter;

use crate::catalogue_manager::{CatalogueEntry, register_plugin_entries, remove_plugin_entries};
use crate::child_process::ChildPluginProcess;
Expand Down Expand Up @@ -221,10 +221,10 @@ async fn start_plugin_process(manifest: &PactPluginManifest) -> anyhow::Result<P
}
debug!("Starting plugin using {:?}", path);

let log_level = max_level();
let log_level = LevelFilter::current();
let child = Command::new(path)
.env("LOG_LEVEL", log_level.as_str())
.env("RUST_LOG", log_level.as_str())
.env("LOG_LEVEL", log_level.to_string())
.env("RUST_LOG", log_level.to_string())
.current_dir(manifest.plugin_dir.clone())
.stdout(Stdio::piped())
.stderr(Stdio::piped())
Expand Down

0 comments on commit e194ab9

Please sign in to comment.