surrealcs_kernel/logging/messages/actors_client/
transaction.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//! Defines the logging of transaction messages sent to the client Transaction Actor.
use crate::logging::messages::transactions::base::TransactionJourney;
use crate::messages::client::message::TransactionMessage;

const TARGET: &str = "surrealcs::kernel::client::transaction";

/// Logs a transaction message that the client Transaction Actor has received.
///
/// # Arguments
/// * `message`: the transaction message that the client Transaction Actor has received
pub fn log_start_client_transaction_actor_message(message: &TransactionMessage) {
	if let TransactionMessage::TransactionOperation(operation) = &message {
		let tx_pointer = TransactionJourney::RecievedByClientTransactionActor;
		let log = tx_pointer.from_wrapped_server_message(operation);
		if let Some(log) = log {
			tracing::trace!(target: TARGET, "{log}");
		}
	}
}