Skip to content

Commit cb4f261

Browse files
Copilotjsturtevant
andcommitted
Replace log crate with tracing crate in dependencies and code
Co-authored-by: jsturtevant <[email protected]>
1 parent 8801c1f commit cb4f261

File tree

22 files changed

+43
-47
lines changed

22 files changed

+43
-47
lines changed

src/hyperlight_common/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ workspace = true
1717
[dependencies]
1818
flatbuffers = { version = "25.9.23", default-features = false }
1919
anyhow = { version = "1.0.100", default-features = false }
20-
log = "0.4.29"
2120
tracing = { version = "0.1.43", optional = true }
2221
arbitrary = {version = "1.4.2", optional = true, features = ["derive"]}
2322
spin = "0.10.0"
@@ -29,7 +28,7 @@ tracing = ["dep:tracing"]
2928
fuzzing = ["dep:arbitrary"]
3029
trace_guest = []
3130
mem_profile = []
32-
std = ["thiserror/std", "log/std", "tracing/std"]
31+
std = ["thiserror/std", "tracing/std"]
3332

3433
[lib]
3534
bench = false # see https://bheisler.github.io/criterion.rs/book/faq.html#cargo-bench-gives-unrecognized-option-errors-for-valid-command-line-options

src/hyperlight_component_util/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ proc-macro2 = { version = "1.0.103" }
2121
syn = { version = "2.0.111" }
2222
itertools = { version = "0.14.0" }
2323
prettyplease = { version = "0.2.37" }
24-
log = { version = "0.4" }
24+
tracing = { version = "0.1.43" }

src/hyperlight_component_util/src/emit.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ impl<'a, 'b> State<'a, 'b> {
416416
let Some(ref mut cnvs) = self.cur_needs_vars else {
417417
return;
418418
};
419-
log::debug!("debug varref: recording {:?} for var {:?}", cnvs.iter(), un);
419+
tracing::debug!("debug varref: recording {:?} for var {:?}", cnvs.iter(), un);
420420
self.vars_needs_vars[un].extend(cnvs.iter());
421421
}
422422
/// Get a list of all the variables needed by a var, given its absolute
@@ -426,7 +426,7 @@ impl<'a, 'b> State<'a, 'b> {
426426
if self.vars_needs_vars.len() < un + 1 {
427427
return BTreeSet::new();
428428
};
429-
log::debug!(
429+
tracing::debug!(
430430
"debug varref: looking up {:?} for var {:?}",
431431
self.vars_needs_vars[un].iter(),
432432
un
@@ -559,7 +559,7 @@ impl<'a, 'b> State<'a, 'b> {
559559
Defined::Handleable(Handleable::Var(tv)) => match tv {
560560
Tyvar::Bound(n) => {
561561
let bv = &self.bound_vars[self.var_offset + (*n as usize)];
562-
log::debug!("checking an origin {:?} {:?}", bv.origin, self.origin);
562+
tracing::debug!("checking an origin {:?} {:?}", bv.origin, self.origin);
563563
if bv.origin.matches(self.origin.iter()) {
564564
Some((*n, bv.bound.clone()))
565565
} else {
@@ -588,7 +588,7 @@ impl<'a, 'b> State<'a, 'b> {
588588
///
589589
/// Precondition: all named traits/modules must exist
590590
pub fn resolve_trait_immut(&self, absolute: bool, path: &[Ident]) -> &Trait {
591-
log::debug!("resolving trait {:?} {:?}", absolute, path);
591+
tracing::debug!("resolving trait {:?} {:?}", absolute, path);
592592
let mut m = if absolute {
593593
&*self.root_mod
594594
} else {
@@ -611,7 +611,7 @@ impl<'a, 'b> State<'a, 'b> {
611611
.enumerate()
612612
.for_each(|(i, vs)| {
613613
*vs = vs.iter().map(|v| v + n).collect();
614-
log::debug!("updated {:?} to {:?}", i, *vs);
614+
tracing::debug!("updated {:?} to {:?}", i, *vs);
615615
});
616616
for _ in 0..n {
617617
self.vars_needs_vars.push_front(BTreeSet::new());

src/hyperlight_component_util/src/guest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ fn emit_component<'a, 'b, 'c>(
344344
/// - functions when given a type that implements the `Guest` trait
345345
pub fn emit_toplevel<'a, 'b, 'c>(s: &'c mut State<'a, 'b>, n: &str, ct: &'c Component<'b>) {
346346
s.is_impl = true;
347-
log::debug!("\n\n=== starting guest emit ===\n");
347+
tracing::debug!("\n\n=== starting guest emit ===\n");
348348
let wn = split_wit_name(n);
349349

350350
let ns = wn.namespace_path();

src/hyperlight_component_util/src/hl.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ pub fn emit_hl_unmarshal_value(s: &mut State, id: Ident, vt: &Value) -> TokenStr
298298
}
299299
Value::Own(ht) => {
300300
let vi = resolve_handleable_to_resource(s, ht);
301-
log::debug!("resolved ht to r (1) {:?} {:?}", ht, vi);
301+
tracing::debug!("resolved ht to r (1) {:?} {:?}", ht, vi);
302302
if s.is_guest {
303303
let rid = format_ident!("HostResource{}", vi);
304304
if s.is_wasmtime_guest {
@@ -326,7 +326,7 @@ pub fn emit_hl_unmarshal_value(s: &mut State, id: Ident, vt: &Value) -> TokenStr
326326
}
327327
Value::Borrow(ht) => {
328328
let vi = resolve_handleable_to_resource(s, ht);
329-
log::debug!("resolved ht to r (2) {:?} {:?}", ht, vi);
329+
tracing::debug!("resolved ht to r (2) {:?} {:?}", ht, vi);
330330
if s.is_guest {
331331
let rid = format_ident!("HostResource{}", vi);
332332
if s.is_wasmtime_guest {
@@ -624,7 +624,7 @@ pub fn emit_hl_marshal_value(s: &mut State, id: Ident, vt: &Value) -> TokenStrea
624624
}
625625
Value::Own(ht) => {
626626
let vi = resolve_handleable_to_resource(s, ht);
627-
log::debug!("resolved ht to r (3) {:?} {:?}", ht, vi);
627+
tracing::debug!("resolved ht to r (3) {:?} {:?}", ht, vi);
628628
if s.is_guest {
629629
let call = if s.is_wasmtime_guest {
630630
quote! { () }
@@ -645,7 +645,7 @@ pub fn emit_hl_marshal_value(s: &mut State, id: Ident, vt: &Value) -> TokenStrea
645645
}
646646
Value::Borrow(ht) => {
647647
let vi = resolve_handleable_to_resource(s, ht);
648-
log::debug!("resolved ht to r (6) {:?} {:?}", ht, vi);
648+
tracing::debug!("resolved ht to r (6) {:?} {:?}", ht, vi);
649649
if s.is_guest {
650650
let call = if s.is_wasmtime_guest {
651651
quote! { () }

src/hyperlight_component_util/src/host.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ fn emit_import_extern_decl<'a, 'b, 'c>(
202202
ExternDesc::CoreModule(_) => panic!("core module (im/ex)ports are not supported"),
203203
ExternDesc::Func(ft) => {
204204
let hln = emit_fn_hl_name(s, ed.kebab_name);
205-
log::debug!("providing host function {}", hln);
205+
tracing::debug!("providing host function {}", hln);
206206
let (pds, pus) = ft
207207
.params
208208
.iter()
@@ -382,7 +382,7 @@ fn emit_component<'a, 'b, 'c>(s: &'c mut State<'a, 'b>, wn: WitName, ct: &'c Com
382382
/// See [`emit_component`]
383383
pub fn emit_toplevel<'a, 'b, 'c>(s: &'c mut State<'a, 'b>, n: &str, ct: &'c Component<'b>) {
384384
s.is_impl = true;
385-
log::debug!("\n\n=== starting host emit ===\n");
385+
tracing::debug!("\n\n=== starting host emit ===\n");
386386
let wn = split_wit_name(n);
387387
emit_component(s, wn, ct)
388388
}

src/hyperlight_component_util/src/rtypes.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ fn try_find_local_var_id(
164164
return Some(emit_resource_ref(s, n, path));
165165
}
166166
}
167-
log::debug!("path is {:?}\n", path);
167+
tracing::debug!("path is {:?}\n", path);
168168
let mut path = path.iter().rev();
169169
let name = kebab_to_type(path.next().unwrap().name());
170170
let owner = path.next();
@@ -216,7 +216,7 @@ pub fn emit_var_ref_value(s: &mut State, tv: &Tyvar) -> TokenStream {
216216
/// the bound variable being referenced
217217
/// - `is_value`: whether this is a value (e.g. constructor) or type context.
218218
pub fn emit_var_ref_noff(s: &mut State, n: u32, is_value: bool) -> TokenStream {
219-
log::debug!("var_ref {:?} {:?}", &s.bound_vars[n as usize], s.origin);
219+
tracing::debug!("var_ref {:?} {:?}", &s.bound_vars[n as usize], s.origin);
220220
// if the variable was defined locally, try to reference it directly
221221
let id = try_find_local_var_id(s, n);
222222
let id = match id {
@@ -317,7 +317,7 @@ pub fn emit_value(s: &mut State, vt: &Value) -> TokenStream {
317317
wrap(emit_var_ref(s, tv))
318318
} else {
319319
let n = crate::hl::resolve_handleable_to_resource(s, ht);
320-
log::debug!("resolved ht to r (4) {:?} {:?}", ht, n);
320+
tracing::debug!("resolved ht to r (4) {:?} {:?}", ht, n);
321321
let id = format_ident!("HostResource{}", n);
322322
wrap(quote! { #id })
323323
}
@@ -339,7 +339,7 @@ pub fn emit_value(s: &mut State, vt: &Value) -> TokenStream {
339339
wrap(emit_var_ref(s, tv))
340340
} else {
341341
let n = crate::hl::resolve_handleable_to_resource(s, ht);
342-
log::debug!("resolved ht to r (5) {:?} {:?}", ht, n);
342+
tracing::debug!("resolved ht to r (5) {:?} {:?}", ht, n);
343343
let id = format_ident!("HostResource{}", n);
344344
wrap(quote! { #id })
345345
}
@@ -619,7 +619,7 @@ fn emit_extern_decl<'a, 'b, 'c>(
619619
s: &'c mut State<'a, 'b>,
620620
ed: &'c ExternDecl<'b>,
621621
) -> TokenStream {
622-
log::debug!(" emitting decl {:?}", ed.kebab_name);
622+
tracing::debug!(" emitting decl {:?}", ed.kebab_name);
623623
match &ed.desc {
624624
ExternDesc::CoreModule(_) => panic!("core module (im/ex)ports are not supported"),
625625
ExternDesc::Func(ft) => {
@@ -749,7 +749,7 @@ fn emit_extern_decl<'a, 'b, 'c>(
749749
/// Emit (via mutating `s`) a Rust trait declaration corresponding to
750750
/// this instance type
751751
fn emit_instance<'a, 'b, 'c>(s: &'c mut State<'a, 'b>, wn: WitName, it: &'c Instance<'b>) {
752-
log::debug!("emitting instance {:?}", wn);
752+
tracing::debug!("emitting instance {:?}", wn);
753753
let mut s = s.with_cursor(wn.namespace_idents());
754754

755755
let name = kebab_to_type(wn.name);
@@ -801,7 +801,7 @@ fn emit_instance<'a, 'b, 'c>(s: &'c mut State<'a, 'b>, wn: WitName, it: &'c Inst
801801
}
802802

803803
drop(sv);
804-
log::debug!("after exports, ncur_needs_vars is {:?}", needs_vars);
804+
tracing::debug!("after exports, ncur_needs_vars is {:?}", needs_vars);
805805
for v in needs_vars {
806806
let id = s.noff_var_id(v);
807807
s.cur_trait().tvs.insert(id, (Some(v), TokenStream::new()));

src/hyperlight_component_util/src/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub fn read_wit_type_from_file<R, F: FnMut(String, &etypes::Component) -> R>(
4747
let ExternDesc::Component(ct) = &export.desc else {
4848
panic!("malformed component type container: does not contain component type");
4949
};
50-
log::debug!("hcm: considering component type {:?}", ct);
50+
tracing::debug!("hcm: considering component type {:?}", ct);
5151
cb(export.kebab_name.to_string(), ct)
5252
}
5353

src/hyperlight_guest_bin/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ hyperlight-common = { workspace = true, default-features = false }
2727
hyperlight-guest-tracing = { workspace = true, default-features = false }
2828
hyperlight-guest-macro = { workspace = true, default-features = false, optional = true }
2929
buddy_system_allocator = "0.11.0"
30-
log = { version = "0.4", default-features = false }
3130
linkme = { version = "0.3.35", optional = true }
3231
spin = "0.10.0"
3332
flatbuffers = { version = "25.2.10", default-features = false }

src/hyperlight_guest_capi/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ hyperlight-guest-bin = { workspace = true, default-features = true }
1717
hyperlight-common = { workspace = true, default-features = false }
1818

1919
flatbuffers = { version = "25.2.10", default-features = false }
20-
log = { version = "0.4", default-features = false }
20+
tracing = { version = "0.1.43", default-features = false }
2121

2222
[build-dependencies]
2323
cbindgen = "0.29.2"

0 commit comments

Comments
 (0)