Use field shorthands in tracing macros

Automated using search `\b(\w+) = \?\1` => replace `?$1`.
This commit is contained in:
Jonas Platte
2022-03-25 16:29:20 +01:00
committed by Jonas Platte
parent f375d8c141
commit d56d50e96f
7 changed files with 16 additions and 19 deletions

View File

@@ -320,7 +320,7 @@ impl BackupMachine {
info!(
key_count = key_count,
keys = ?session_record,
backup_key = ?backup_key,
?backup_key,
"Successfully created a room keys backup request"
);

View File

@@ -232,7 +232,7 @@ impl GossipMachine {
// We ignore cancellations here since there's nothing to serve.
RequestAction::RequestCancellation => return Ok(None),
action => {
warn!(action = ?action, "Unknown secret request action");
warn!(?action, "Unknown secret request action");
return Ok(None);
}
};
@@ -240,7 +240,7 @@ impl GossipMachine {
let content = if let Some(secret) = self.store.export_secret(secret_name).await {
SecretSendEventContent::new(event.content.request_id.to_owned(), secret)
} else {
info!(secret_name = ?secret_name, "Can't serve a secret request, secret isn't found");
info!(?secret_name, "Can't serve a secret request, secret isn't found");
return Ok(None);
};
@@ -253,7 +253,7 @@ impl GossipMachine {
info!(
user_id = device.user_id().as_str(),
device_id = device.device_id().as_str(),
secret_name = ?secret_name,
?secret_name,
"Sharing a secret with a device",
);
@@ -277,7 +277,7 @@ impl GossipMachine {
info!(
user_id = device.user_id().as_str(),
device_id = device.device_id().as_str(),
secret_name = ?secret_name,
?secret_name,
"Received a secret request that we won't serve, the device isn't trusted",
);
@@ -287,7 +287,7 @@ impl GossipMachine {
info!(
user_id = device.user_id().as_str(),
device_id = device.device_id().as_str(),
secret_name = ?secret_name,
?secret_name,
"Received a secret request that we won't serve, the device doesn't belong to us",
);
@@ -297,7 +297,7 @@ impl GossipMachine {
warn!(
user_id = event.sender.as_str(),
device_id = event.content.requesting_device_id.as_str(),
secret_name = ?secret_name,
?secret_name,
"Received a secret request form an unknown device",
);
self.store.update_tracked_user(&event.sender, true).await?;
@@ -390,7 +390,7 @@ impl GossipMachine {
device_id = device.device_id().as_str(),
session_id = key_info.session_id.as_str(),
room_id = key_info.room_id.as_str(),
message_index = ?message_index,
?message_index,
"Serving a room key request",
);
@@ -618,7 +618,7 @@ impl GossipMachine {
secret_names: Vec<SecretName>,
) -> Vec<GossipRequest> {
if !secret_names.is_empty() {
info!(secret_names = ?secret_names, "Creating new outgoing secret requests");
info!(?secret_names, "Creating new outgoing secret requests");
secret_names
.into_iter()

View File

@@ -249,10 +249,7 @@ impl OlmMachine {
.master_public_key()
.await
.and_then(|m| m.get_first_key().map(|m| m.to_owned()));
debug!(
master_key = ?master_key,
"Restored the cross signing identity"
);
debug!(?master_key, "Restored the cross signing identity");
i
}
None => {

View File

@@ -329,8 +329,8 @@ impl GroupSessionManager {
let mut devices: HashMap<Box<UserId>, Vec<Device>> = HashMap::new();
trace!(
users = ?users,
history_visibility = ?history_visibility,
?users,
?history_visibility,
session_id = outbound.session_id(),
room_id = outbound.room_id().as_str(),
"Calculating group session recipients"
@@ -505,7 +505,7 @@ impl GroupSessionManager {
info!(
index = message_index,
recipients = ?recipients,
?recipients,
room_id = room_id.as_str(),
session_id = outbound.session_id(),
"Trying to encrypt a room key",

View File

@@ -505,7 +505,7 @@ impl Store {
.await?;
let status = identity.status().await;
info!(status = ?status, "Successfully imported the private cross signing keys");
info!(?status, "Successfully imported the private cross signing keys");
let changes =
Changes { private_identity: Some(identity.clone()), ..Default::default() };

View File

@@ -357,7 +357,7 @@ impl VerificationMachine {
trace!(
sender = event.sender().as_str(),
from_device = r.from_device().as_str(),
timestamp = ?timestamp,
?timestamp,
"The received verification request was too old or too far into the future",
);
}

View File

@@ -402,7 +402,7 @@ impl Client {
let room = rooms.into_iter().find(|r| r.direct_target().as_deref() == Some(user_id));
trace!(room = ?room, "Found room");
trace!(?room, "Found room");
room
}