openzeppelin_relayer/utils/
service_info_log.rs

1//! This module contains the function to log service information at startup.
2use log::info;
3use std::env;
4
5/// Logs service information at startup
6pub fn log_service_info() {
7    let service_name = env!("CARGO_PKG_NAME");
8    let service_version = env!("CARGO_PKG_VERSION");
9
10    info!("=== OpenZeppelin Relayer Service Starting ===");
11    info!("🚀 Service: {} v{}", service_name, service_version);
12    info!("đŸĻ€ Rust Version: {}", env!("CARGO_PKG_RUST_VERSION"));
13
14    // Log environment information
15    if let Ok(profile) = env::var("CARGO_PKG_PROFILE") {
16        info!("🔧 Build Profile: {}", profile);
17    }
18
19    // Log system information
20    info!("đŸ’ģ Platform: {}", env::consts::OS);
21    info!("đŸ’ģ Architecture: {}", env::consts::ARCH);
22
23    // Log current working directory
24    if let Ok(cwd) = env::current_dir() {
25        info!("📁 Working Directory: {}", cwd.display());
26    }
27
28    // Log important environment variables if present
29    if let Ok(rust_log) = env::var("RUST_LOG") {
30        info!("🔧 Log Level: {}", rust_log);
31    }
32
33    if let Ok(config_path) = env::var("CONFIG_PATH") {
34        info!("🔧 Config Path: {}", config_path);
35    }
36
37    // Log startup timestamp
38    info!(
39        "🕒 Started at: {}",
40        chrono::Utc::now().format("%Y-%m-%d %H:%M:%S UTC")
41    );
42
43    // log docs url
44    info!("â„šī¸ Visit the Relayer documentation for more information https://docs.openzeppelin.com/relayer/");
45}