| Crates.io | moosicbox_logging |
| lib.rs | moosicbox_logging |
| version | 0.1.4 |
| created_at | 2024-10-04 15:12:44.530784+00 |
| updated_at | 2025-07-21 19:12:04.385855+00 |
| description | MoosicBox logging package |
| homepage | |
| repository | https://github.com/MoosicBox/MoosicBox |
| max_upload_size | |
| id | 1396686 |
| size | 51,499 |
Basic logging utilities with feature-gated modules for MoosicBox applications.
The MoosicBox Logging package provides:
free_log feature)macros feature)free_log: Enables free_log integration modulemacros: Enables logging macro utilities[dependencies]
moosicbox_logging = { path = "../logging" }
# Enable specific features
moosicbox_logging = {
path = "../logging",
features = ["free_log", "macros"]
}
#[cfg(feature = "free_log")]
use moosicbox_logging::*; // Free log functionality
#[cfg(feature = "free_log")]
async fn setup_logging() -> Result<(), Box<dyn std::error::Error>> {
// Use free_log integration
// (implementation details depend on the free_log module)
Ok(())
}
#[cfg(feature = "macros")]
use moosicbox_logging::*; // Logging macros
#[cfg(feature = "macros")]
fn use_logging_macros() {
// Use logging macro utilities
// (implementation details depend on the macros module)
}
// Basic usage without features
// (minimal functionality available)
#[cfg(all(feature = "free_log", feature = "macros"))]
async fn full_logging_setup() -> Result<(), Box<dyn std::error::Error>> {
// Both free_log and macros available
// Use complete logging functionality
Ok(())
}
free_log featuremacros featurefree_log: Enables free_log integration modulemacros: Enables logging macro utilitiesThis package currently provides:
The actual logging implementations are contained within the feature-gated modules. Enable the appropriate features to access logging functionality.
// Feature-gated imports
#[cfg(feature = "free_log")]
use moosicbox_logging::*; // Free log functions
#[cfg(feature = "macros")]
use moosicbox_logging::*; // Logging macros
// Conditional compilation based on features
#[cfg(feature = "free_log")]
fn setup_free_log() {
// Free log setup
}
#[cfg(feature = "macros")]
fn use_macros() {
// Use logging macros
}
This design allows consumers to include only the logging components they need, keeping the package lightweight while providing extensible logging capabilities.