A dead simple logger that works globally and across threads.

Related tags

Logging woody
Overview

Woody

A logger for Rust that's *actually* easy to use.

Features

  • Easy to use: Just import the macros and you're good to go. No need to configure anything. No need to create a logger. Just log.
  • Versatile: Log messages at different levels, works across threads, and can be used in libraries.
  • Lightweight: Relies only on lazy_static for thread safety and chrono for timestamps (in addition to the standard library).

Usage

Add this to your Cargo.toml:

[dependencies]
woody = { git = "https://github.com/trvswgnr/woody.git" }

Examples

use woody::*;

fn main() {
    log!(LogLevel::Info, "An info message.");
    log_debug!("A debug message.");
    log_info!("An info message.");
    log_warn!("A warning message.");
    log_error!("An error message.");
    log_trace!("A trace message.");
}

Logs are output to the woody.log file in the current directory.

Environment variables can be set to control the log level and output file:

$ WOODY_LEVEL=error cargo run # Only error messages will be logged
$ WOODY_FILE=woodyrulez.log cargo run # Logs will be written to woodyrulez.log
You might also like...
Compute and derive metrics by watching a log file
Compute and derive metrics by watching a log file

Export Prometheus metrics from your web server's access log Web servers only offer limited metrics. For example, nginx only offers stub_status unless

SWC Transform to prefix logs. Useful for adding file and line number to logs

SWC Transform to prefix logs. Useful for adding file and line number to logs

A rust library for creating and managing logs of arbitrary binary data

A rust library for creating and managing logs of arbitrary binary data. Presently it's used to collect sensor data. But it should generally be helpful in cases where you need to store timeseries data, in a nearly (but not strictly) append-only fashion.

Log for concurrent workloads, with support for atomic batches and in-order recovery

sharded-log A batch-oriented multi-threaded sharded log for workloads that occasionally flush logs into some other system. All batches have a 32-bit C

godot-logger is an easy-to-use logger for godot-rust projects.

godot-logger is an easy-to-use logger for godot-rust projects. It prints logs to Godot's output console and supports module-specific log levels.

Tiny crate that allows to wait for a stop signal across multiple threads

Tiny crate that allows to wait for a stop signal across multiple threads. Helpful mostly in server applications that run indefinitely and need a signal for graceful shutdowns.

A type-safe, K-sortable, globally unique identifier

type-safe-id A type-safe, K-sortable, globally unique identifier. Typed implementation of https://github.com/jetpack-io/typeid in Rust. Examples Stati

Rall is an incredibly simple and intuitive logger
Rall is an incredibly simple and intuitive logger

Really...? Another Logging Library? Yes! :P rall is an incredibly simple and intuitive logger, consider this crate a failure if you can't get setup wi

A Discord bot for control and decentralization of threads management
A Discord bot for control and decentralization of threads management

Threadripper-bot A Discord bot for control and decentralization of threads management About Threadripper aims to serve some extra utilities to take be

Tiny CLI application in rust to scan ports from a given IP and find how many are open. You can also pass the amount of threads for that scan

Port Scanner A simple multi-threaded port scanner written in Rust. Usage Run the port scanner by providing the target IP address and optional flags. $

A rust library for sharing and updating arbitrary slices between threads, optimized for wait-free reads

atomicslice A Rust library for thread-safe shared slices that are just about as fast as possible to read while also being writable. Overview Use Atomi

Super lightweight and dead-simple CI detection.

This crate tells you if you're in a CI environment or not. It does not tell you which you're in, but it makes a good effort to make sure to accurately

Style terminal outputs in a minimal, macro-based, and dead simple way.

sty 🌈 $\mathbb{\color{red}{Style \ } \color{lightblue}{terminal}\ \color{black}{outputs \ }\color{gray}{\ in\ a} \color{magenta}{\ minimal}\color{gra

A simple and lightweight fuzzy search engine that works in memory, searching for similar strings (a pun here).

simsearch A simple and lightweight fuzzy search engine that works in memory, searching for similar strings (a pun here). Documentation Usage Add the f

Kusa is a simple CLI tool that works on any platform and displays GitHub contribution graphs.
Kusa is a simple CLI tool that works on any platform and displays GitHub contribution graphs.

Kusa is a simple CLI tool that works on any platform and displays GitHub contribution graphs. Installation Homebrew (only macOS) $ brew tap Ryu0118/Ku

[no longer maintained] Scalable, coroutine-based, fibers/green-threads for Rust. (aka MIO COroutines).

Documentation mioco Mioco provides green-threads (aka fibers) like eg. Goroutines in Go, for Rust. Status This repo is a complete re-implementation of

Download a file using multiple threads in parallel for faster download speeds.

multidl Download a file using multiple threads in parallel for faster download speeds. Uses 0 external dependencies. Usage Usage: multidl [--help] ADD

A thread pool for running multiple tasks on a configurable group of threads.
A thread pool for running multiple tasks on a configurable group of threads.

Threadfin A thread pool for running multiple tasks on a configurable group of threads. Extra features: Dynamic pool size based on load Support for asy

A fast rendezvous in rust where data can optionally be swapped between the two threads.

rendezvous_swap A rendezvous is an execution barrier between a pair of threads, but this crate also provides the option of swapping data at the synchr

Owner
Travis A. Wagner
full stack developer, designer, digital marketer, music producer.
Travis A. Wagner
Rall is an incredibly simple and intuitive logger

Really...? Another Logging Library? Yes! :P rall is an incredibly simple and intuitive logger, consider this crate a failure if you can't get setup wi

Hamothy 4 Sep 5, 2022
A pretty, sensible logger for Rust - ideal for running examples and tests on a crate of choice

sensible-env-logger A pretty, sensible logger for Rust - ideal for running examples and tests on a crate of choice. This is a thin wrapper around pret

Ritvik Nag 3 Aug 9, 2022
A pretty, easy-to-use logger for Rust.

pretty-env-logger A simple logger built on top of env_logger. It is configured via an environment variable and writes to standard error with nice colo

Sean McArthur 390 Dec 29, 2022
A Rust logger with various features.

Moe Logger (>ω<) Another logger based on pretty-env-logger and env_logger. Allow writing log to file with features like formatting, file rotation. Usa

Rui Li 4 Sep 24, 2021
A loki logger for the log facade

Loki Logger A loki logger for the log facade. Examples extern crate log; extern crate loki_logger; use log::LevelFilter; #[tokio::main] async fn main

Thomas Nicollet 11 Dec 24, 2022
HTTP request logger

nosy - HTTP request logger How hard can it be to build your own HTTP request logger in Rust? Well, not that easy if you've never written a webapp in R

Manuel Hutter 1 Nov 26, 2021
A standalone, `#![no_std]`-friendly `Logger` crate.

A standalone, #![no_std]-friendly Logger crate. Based on the design of the logger built into the bootloader crate and meant to be used in OS kernels.

Kenny Strawn 1 Feb 6, 2022
Another Key Logger Yet. Rust.

Another Key Logger Yet. Rust. For my very first experience of working with Rust, I decided to manage the keyboard, this time by logging and writing th

(Not) Kearash 0 May 3, 2022
Logpeek is a simple logfile regex matcher program

Logpeek is a simple logfile regex matcher program. It allows matching a file line by line using regular expressions and can be configured using a JSON based configuration file.

Lukas 1 Oct 28, 2021
Firecracker takes your HTTP logs and uses them to map your API flows and to detect anomalies in them.

Who is BLST and what do we do? BLST (Business Logic Security Testing) is a startup company that's developing an automatic penetration tester, replacin

BLST 692 Jan 2, 2023