Kyle J. Turpin Matsubaa
  • Joined on 2026-05-20

kt_log (0.1.4)

Published 2026-08-22 13:44:37 -05:00 by Matsubaa

Installation

[registry]
default = "gitea"

[registries.gitea]
index = "sparse+https://git.moturpin.com/api/packages/Matsubaa/cargo/" # Sparse index
# index = "https://git.moturpin.com/Matsubaa/_cargo-index.git" # Git

[net]
git-fetch-with-cli = true
cargo add kt_log@0.1.4

About this package

A console logging library for Rust applications

kt_log

cargo build cargo test

Tiny console logger for Rust built on the log facade.

Installation

This crate is published to the gitea Cargo registry hosted on git.moturpin.com.

  1. Tell Cargo about the registry (once per machine/workspace), e.g. in .cargo/config.toml:
[registries.gitea]
index = "sparse+https://git.moturpin.com/api/packages/Matsubaa/cargo/"
  1. Add the dependency to your Cargo.toml:
[dependencies]
kt_log = { version = "0.1", registry = "gitea" }

If the registry is private, authenticate with:

cargo login --registry gitea <TOKEN>

Usage

Initialize the logger once at program start, then use the standard log macros. Messages at Error, Warn, and Info are printed; Debug and Trace are ignored by default.

use kt_log::init;
use log::{error, warn, info, debug, trace};

fn main() {
    init().expect("failed to init logger");

    error!("something failed");
    warn!("watch out");
    info!("hello {}", "world");
    debug!("this will not be shown");
    trace!("this will not be shown either");
}

Example output:

[ERROR] something failed
[WARN] watch out
[INFO] hello world

Features

  • Minimal, zero-config console logger
  • Built on log 0.4 — works with the standard logging macros
  • Simple output format: [LEVEL] message
  • Default max level: Info (prints Error, Warn, Info)

Notes & Limitations

  • The maximum log level is currently fixed to Info at initialization time.
  • Debug and Trace messages are intentionally not printed.

Development

  • Build: cargo build
  • Test: cargo test

License

Licensed under the MIT License. See LICENSE.

Contributing

Contributions are welcome. Please see CONTRIBUTING.md.

Details
Cargo
2026-08-22 13:44:37 -05:00
2
MIT
47 KiB
Assets (1)
Versions (4) View all
0.1.4 2026-08-22
0.1.2 2026-08-22
0.1.1 2026-08-22
0.1.0 2026-08-22