#logging #multi-platform #customizable #api-bindings #rust #filelogger

aloe-log

Aloe Log is a flexible logging library for Rust providing application-wide logging capabilities, customizable logger interfaces, and platform-specific output handling strategies. This crate is a translation of the c++ juce module serving the same function.

1 unstable release

Uses new Rust 2024

new 0.1.2 Apr 3, 2025

#9 in #customizable


Used in aloe-exports

GPL-3.0 license

370KB
2.5K SLoC

Aloe Log Crate

Overview

Aloe Log is a robust and extensible logging framework designed for Rust applications. It provides a straightforward yet versatile interface for application-wide logging, with the ability to implement custom logging strategies and direct log messages to various outputs.

Features

Core Traits and Structures

  • LoggerInterface: A trait defining the core log handling method, log_message, which facilitates the integration of custom logging mechanisms.
  • Logger: The central logging structure that applications can use to maintain a consistent logging strategy. Offers functionality to set, get, and use custom loggers dynamically.
  • FileLogger: A straightforward implementation of LoggerInterface that writes log messages to a specified file, managing file size and ensuring systematic logging across different platforms.

Platform-Specific Configurations

  • The framework supports various OS-specific debug output mechanisms via the output_debug_string method across Unix-like systems, Android, WASM, and more.

Logging Management

  • set_current_logger: Assign a new logger implementation at runtime, with safety checks to prevent improper usage.
  • write_to_log: Directs messages to the currently set logger employing the log_message strategy of LoggerInterface.
  • File Management: Includes sophisticated file handling such as truncation for size management and creation of date-stamped logs.

Usage

To use Aloe Log, include it in your Cargo.toml:

[dependencies]
aloe-log = "0.1.0"

Implement the LoggerInterface if a custom logging output is needed.

use aloe_log::LoggerInterface;

struct MyCustomLogger;

impl LoggerInterface for MyCustomLogger {
    fn log_message(&mut self, message: &str) {
        // Custom logging logic here
    }
}

License

Aloe Log is licensed under the GPL-3.0 license.


This README.md file was generated by an AI model and may not be 100% accurate, although it strives to be highly precise.

This crate is a translation of the JUCE module.

JUCE is a c++ software framework for developing high performance audio applications.

Usage falls under the GPLv3 as well as the JUCE commercial license.

See github.com/juce-framework/JUCE and the JUCE license page for details.

This crate is in the process of being translated from c++ to rust. For progress updates, please see the workspacer rust project. designed specifically for rust projects.

Dependencies

~14–23MB
~380K SLoC