Update logging functions
For our logging functions, we still need to log the message to the terminal so logs can still be recovered if there is a problem with our database. This sending of the message to the database should be triggered if the feature is enabled. Considering this, our | function remains the same giving us the following outline:
// glue/src/logger/logger.rs
. . .
#[cfg(feature = "elastic-logger")]
use super::elastic_actor::send_log;
pub fn init_logger() {
. . .
}
Our functions now take the form below:
// glue/src/logger/logger.rs
pub async fn log_info(message: &str) {
tracing::info!("{}", message);
#[cfg(feature = "elastic-logger")]
send_log("INFO", message).await;
}
pub async fn log_warn(message: &str) {
tracing::warn!("{}", message);
#[cfg(feature = "elastic-logger")]
send_log("WARN", message).await;
}
pub async fn log_error(message: &str) {
tracing::error...