alumy

Crates.ioalumy
lib.rsalumy
version0.1.12
created_at2026-01-07 06:19:34.445029+00
updated_at2026-01-15 02:13:39.77595+00
descriptionA batteries-included Rust SDK for rapid application development. Logging, system utilities, and filesystem helpers — all ready to use.
homepagehttps://github.com/alumy/alumy-rs
repositoryhttps://github.com/alumy/alumy-rs
max_upload_size
id2027609
size51,767
(alumy)

documentation

https://docs.rs/alumy

README

alumy

Crates.io Documentation License

A batteries-included Rust SDK for rapid application development. Logging, system utilities, and filesystem helpers — all ready to use.

Features

  • High-Performance Logging: Non-blocking logger based on tracing with fluent configuration API, log rotation, and system uptime timestamps. Works across platforms.
  • System Utilities: Helpers for system information such as uptime (supports Linux, macOS, and Windows).
  • Filesystem Utilities: Size parsing/formatting and path building helpers.
  • Version Management: Macros and functions to access crate metadata at compile time.

Installation

Add this to your Cargo.toml:

[dependencies]
alumy = "0.1.10"
anyhow = "1"

Usage

Logging Setup

Alumy provides a modern, non-blocking logger based on tracing. It re-exports all logging macros (trace!, debug!, info!, warn!, error!) for convenience:

use alumy::{LogConfig, info, debug};

fn main() -> anyhow::Result<()> {
    // Basic setup
    LogConfig::new("my-app", "info").init()?;

    // Advanced setup with log rotation and system uptime
    LogConfig::new("my-app", "debug")
        .with_file("logs/app.log", "10M", 5)
        .with_time_format("uptime")
        .with_ansi(true)
        .with_target(true)
        .init()?;

    info!("Hello, alumy logger!");
    debug!("Debug message");
    Ok(())
}

System Uptime

Access system uptime information:

use alumy::sys::uptime;

fn main() {
    println!("Uptime: {} seconds", uptime::uptime());
    println!("Uptime duration: {:?}", uptime::uptime_duration());
}

Filesystem Utilities

Parse and format file sizes easily:

use alumy::fs::filesize;

fn main() {
    let size = filesize::parse_size("10M").unwrap();
    println!("10M in bytes: {}", size);
    println!("Formatted: {}", filesize::format_size(size)); // "10.0MB"
}

Version Information

Access crate metadata:

use alumy::version;
use alumy::{crate_name, crate_version};

fn main() {
    println!("Running {} v{}", crate_name!(), crate_version!());
    println!("{}", version::hello());
}

License

This project is licensed under the MIT License.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Links

Commit count: 29

cargo fmt