Skip to content

Commit 2f4f80f

Browse files
authored
Merge pull request #516 from davidbarsky/master
chore: use tracing instead of log
2 parents f5f21cf + 86f06d8 commit 2f4f80f

File tree

10 files changed

+17
-17
lines changed

10 files changed

+17
-17
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ crossbeam = "0.8.1"
1414
dashmap = "6.0.1"
1515
hashlink = "0.9.1"
1616
indexmap = "2"
17-
log = "0.4.5"
1817
orx-concurrent-vec = "1.10.0"
18+
tracing = "0.1"
1919
parking_lot = "0.12.1"
2020
rustc-hash = "2.0.0"
2121
salsa-macro-rules = { version = "0.1.0", path = "components/salsa-macro-rules" }

src/cycle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl Cycle {
3434
}
3535

3636
pub(crate) fn throw(self) -> ! {
37-
log::debug!("throwing cycle {:?}", self);
37+
tracing::debug!("throwing cycle {:?}", self);
3838
std::panic::resume_unwind(Box::new(self))
3939
}
4040

src/database.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub trait Database: DatabaseGen {
1111
/// By default, the event is logged at level debug using
1212
/// the standard `log` facade.
1313
fn salsa_event(&self, event: Event) {
14-
log::debug!("salsa_event: {:?}", event)
14+
tracing::debug!("salsa_event: {:?}", event)
1515
}
1616

1717
/// A "synthetic write" causes the system to act *as though* some

src/function/backdate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ where
2323
if revisions.durability >= old_memo.revisions.durability
2424
&& C::should_backdate_value(old_value, value)
2525
{
26-
log::debug!(
26+
tracing::debug!(
2727
"value is equal, back-dating to {:?}",
2828
old_memo.revisions.changed_at,
2929
);

src/function/execute.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ where
3131
let revision_now = runtime.current_revision();
3232
let database_key_index = active_query.database_key_index;
3333

34-
log::info!("{:?}: executing query", database_key_index);
34+
tracing::info!("{:?}: executing query", database_key_index);
3535

3636
db.salsa_event(Event {
3737
runtime_id: runtime.id(),
@@ -47,7 +47,7 @@ where
4747
let value = match Cycle::catch(|| C::execute(db, C::id_to_input(db, key))) {
4848
Ok(v) => v,
4949
Err(cycle) => {
50-
log::debug!(
50+
tracing::debug!(
5151
"{database_key_index:?}: caught cycle {cycle:?}, have strategy {:?}",
5252
C::CYCLE_STRATEGY
5353
);
@@ -98,7 +98,7 @@ where
9898

9999
let stamped_value = revisions.stamped_value(value);
100100

101-
log::debug!("{database_key_index:?}: read_upgrade: result.revisions = {revisions:#?}");
101+
tracing::debug!("{database_key_index:?}: read_upgrade: result.revisions = {revisions:#?}");
102102

103103
stamped_value
104104
}

src/function/maybe_changed_after.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ where
2828
loop {
2929
let database_key_index = self.database_key_index(key);
3030

31-
log::debug!("{database_key_index:?}: maybe_changed_after(revision = {revision:?})");
31+
tracing::debug!("{database_key_index:?}: maybe_changed_after(revision = {revision:?})");
3232

3333
// Check if we have a verified version: this is the hot path.
3434
let memo_guard = self.memo_map.get(key);
@@ -70,7 +70,7 @@ where
7070
None => return Some(true),
7171
};
7272

73-
log::debug!(
73+
tracing::debug!(
7474
"{database_key_index:?}: maybe_changed_after_cold, successful claim, \
7575
revision = {revision:?}, old_memo = {old_memo:#?}",
7676
);
@@ -106,7 +106,7 @@ where
106106
let verified_at = memo.verified_at.load();
107107
let revision_now = runtime.current_revision();
108108

109-
log::debug!("{database_key_index:?}: shallow_verify_memo(memo = {memo:#?})",);
109+
tracing::debug!("{database_key_index:?}: shallow_verify_memo(memo = {memo:#?})",);
110110

111111
if verified_at == revision_now {
112112
// Already verified.
@@ -141,7 +141,7 @@ where
141141
let runtime = db.runtime();
142142
let database_key_index = active_query.database_key_index;
143143

144-
log::debug!("{database_key_index:?}: deep_verify_memo(old_memo = {old_memo:#?})",);
144+
tracing::debug!("{database_key_index:?}: deep_verify_memo(old_memo = {old_memo:#?})",);
145145

146146
if self.shallow_verify_memo(db, runtime, database_key_index, old_memo) {
147147
return true;

src/function/memo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl<V> Memo<V> {
132132
pub(super) fn check_durability(&self, runtime: &Runtime) -> bool {
133133
let last_changed = runtime.last_changed_revision(self.revisions.durability);
134134
let verified_at = self.verified_at.load();
135-
log::debug!(
135+
tracing::debug!(
136136
"check_durability(last_changed={:?} <= verified_at={:?}) = {:?}",
137137
last_changed,
138138
self.verified_at,

src/function/specify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ where
8787
revisions,
8888
};
8989

90-
log::debug!("specify: about to add memo {:#?} for key {:?}", memo, key);
90+
tracing::debug!("specify: about to add memo {:#?} for key {:?}", memo, key);
9191
self.insert_memo(db, key, memo);
9292
}
9393

src/runtime.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ impl Runtime {
362362
database_key_index: DatabaseKeyIndex,
363363
to_id: RuntimeId,
364364
) {
365-
log::debug!(
365+
tracing::debug!(
366366
"unblock_cycle_and_maybe_throw(database_key={:?})",
367367
database_key_index
368368
);
@@ -404,7 +404,7 @@ impl Runtime {
404404

405405
Cycle::new(Arc::new(v))
406406
};
407-
log::debug!("cycle {cycle:?}, cycle_query {cycle_query:#?}");
407+
tracing::debug!("cycle {cycle:?}, cycle_query {cycle_query:#?}");
408408

409409
// We can remove the cycle participants from the list of dependencies;
410410
// they are a strongly connected component (SCC) and we only care about
@@ -427,7 +427,7 @@ impl Runtime {
427427
}
428428
})
429429
.for_each(|aq| {
430-
log::debug!("marking {:?} for fallback", aq.database_key_index);
430+
tracing::debug!("marking {:?} for fallback", aq.database_key_index);
431431
aq.take_inputs_from(&cycle_query);
432432
assert!(aq.cycle.is_none());
433433
aq.cycle = Some(cycle.clone());

src/runtime/local_state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use log::debug;
1+
use tracing::debug;
22

33
use crate::durability::Durability;
44
use crate::key::DatabaseKeyIndex;

0 commit comments

Comments
 (0)