Skip to content

Commit

Permalink
fix: PactNative.init needs to be re-entrant
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronald Holshausen committed Jun 28, 2020
1 parent 3c8cd2c commit 16c22f6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions native/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ lazy_static! {
fn init(mut cx: FunctionContext) -> JsResult<JsString> {
let mut builder = Builder::from_env("LOG_LEVEL");
builder.target(Target::Stdout);
builder.init();

debug!("Initialising Pact native library version {}", env!("CARGO_PKG_VERSION"));

if let Ok(_) = builder.try_init() {
debug!("Initialising Pact native library version {}", env!("CARGO_PKG_VERSION"));
}

Ok(cx.string(env!("CARGO_PKG_VERSION")))
}
Expand Down

0 comments on commit 16c22f6

Please sign in to comment.