armature-log

Crates.ioarmature-log
lib.rsarmature-log
version0.1.0
created_at2025-12-26 19:44:19.392392+00
updated_at2025-12-26 19:44:19.392392+00
descriptionLogging utilities for the Armature framework
homepagehttps://pegasusheavy.github.io/armature
repositoryhttps://github.com/pegasusheavy/armature
max_upload_size
id2006150
size47,578
Joseph R. Quinn (quinnjr)

documentation

README

armature-log

Logging utilities for the Armature framework.

Features

  • JSON by Default - Structured logging for production
  • Pretty Output - Human-readable format for development
  • Environment Config - Configure via ARMATURE_* env vars
  • Runtime Config - Programmatic configuration API
  • Zero Dependencies - Minimal footprint (optional tracing integration)

Installation

[dependencies]
armature-log = "0.1"

Quick Start

use armature_log::{info, debug, error};

fn main() {
    // Uses ARMATURE_DEBUG and ARMATURE_LOG_LEVEL env vars
    armature_log::init();

    info!("Application started");
    debug!("Debug message");
    error!("Something went wrong");
}

Configuration

Environment Variables

Variable Values Default
ARMATURE_DEBUG 1, true false
ARMATURE_LOG_LEVEL trace, debug, info, warn, error info
ARMATURE_LOG_FORMAT json, pretty, compact json
ARMATURE_LOG_COLOR 1, true auto-detect TTY

Programmatic

use armature_log::{configure, Format, Level};

configure()
    .format(Format::Pretty)
    .level(Level::Debug)
    .color(true)
    .apply();

Presets

// Development: Pretty, Debug, Colors
armature_log::preset_development();

// Production: JSON, Info, No colors
armature_log::preset_production();

License

MIT OR Apache-2.0

Commit count: 0

cargo fmt