Skip to main content

datex_core/runtime/
logger.rs

1use crate::runtime::RuntimeInternal;
2
3impl RuntimeInternal {
4    /// Logs an info message with the runtime's endpoint as a prefix.
5    pub fn log_info<S: AsRef<str>>(&self, message: S) {
6        log::info!("[{}] {}", self.endpoint(), message.as_ref());
7    }
8
9    /// Logs an error message with the runtime's endpoint as a prefix.
10    pub fn log_error<S: AsRef<str>>(&self, message: S) {
11        log::error!("[{}] {}", self.endpoint(), message.as_ref());
12    }
13
14    /// Logs a debug message with the runtime's endpoint as a prefix.
15    pub fn log_debug<S: AsRef<str>>(&self, message: S) {
16        log::debug!("[{}] {}", self.endpoint(), message.as_ref());
17    }
18
19    /// Logs a warning message with the runtime's endpoint as a prefix.
20    pub fn log_warn<S: AsRef<str>>(&self, message: S) {
21        log::warn!("[{}] {}", self.endpoint(), message.as_ref());
22    }
23}