//! 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;

/// 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) {
	let pointer = TransactionJourney::RecievedByClientTransactionActor;

	if let TransactionMessage::TransactionOperation(operation) = &message {
		let log = pointer.from_wrapped_server_message(operation);
		if log.is_some() {
			tracing::trace!("{}", log.unwrap());
		}
	}
}
