pub mod core;
pub mod handler;
pub use core::LoanInput;
pub use core::LoanResult;
pub use handler::config::CalculatorConfig;
pub use handler::error::{ApiError, CalculationError};
pub use handler::TopUpHandler;
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
pub fn init_logging() {
use tracing_subscriber::prelude::*;
let stdout = tracing_subscriber::fmt::layer()
.json()
.with_current_span(true)
.with_span_list(true)
.with_target(true)
.with_level(true)
.with_thread_ids(true)
.with_thread_names(true)
.with_file(true)
.with_line_number(true);
let subscriber = tracing_subscriber::registry()
.with(stdout)
.with(tracing_subscriber::EnvFilter::from_default_env());
tracing::subscriber::set_global_default(subscriber).expect("Failed to set subscriber");
tracing::info!(
event = "logging_initialized",
version = VERSION,
format = "json",
"Logging initialized successfully"
);
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_version() {
assert!(!VERSION.is_empty());
}
}