surrealcs_kernel/logging/messages/actors_server/
router.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 server router.
use crate::logging::messages::connections::ping::PingJourney;
use crate::logging::messages::transactions::base::TransactionJourney;
use crate::messages::server::{interface::ServerMessage, wrapper::WrappedServerMessage};

/// Logs a transaction message that the server router has received.
///
/// # Arguments
/// * `message`: the transaction message that the server router has received
pub fn log_server_router_message(message: &WrappedServerMessage) {
	if let ServerMessage::Ping(_) = &message.message {
		tracing::trace!("{}", PingJourney::RecievedByServerRouter.to_log(&message.connection_id));
	}
	let tx_pointer = TransactionJourney::RecievedByServerRouter;
	let log = tx_pointer.from_wrapped_server_message(message);
	if log.is_some() {
		tracing::trace!("{}", log.unwrap());
	}
}