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

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

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

A dead simple ANSI terminal color painting library for Rust.

yansi A dead simple ANSI terminal color painting library for Rust. use yansi::Paint; print!("{} light, {} light!", Paint::green("Green"), Paint::red(

A dead simple functional testing tool for command line applications

Pharaoh : build that test pyramid! What it is Pharaoh is a dead simple, no permission needed, functional test runner for command line applications, wr

A dead simple configuration language.

Rakh! A dead simple configuration language. No seriously, it's simple. With only 26 lines of code, it's one of the tiniest configuration languages the

A dead-simple, extreme fast permission flag system for Rust with no dependencies

A dead-simple, extreme fast permission flag system for Rust with no dependencies

🥅 Dead simple webhook worker for Sentry to output events in a Discord channel
🥅 Dead simple webhook worker for Sentry to output events in a Discord channel

🥅 Sentry Webhook Dead simple webhook worker for Sentry to output events in a Discord channel Why? This is just a simple Rust HTTP service to do so, t

A dead simple human-writable URL redirector based loosely on google's `go/` system.

Redirector a redirector written in rust intended for permanent human-readable redirects. The idea was semi-inspired by the book Software Engineering a

A dead-simple tool for working with data in Kafka
A dead-simple tool for working with data in Kafka

ktool - a tool for Kafka ktool is a dead-simple tool for working with data in Kafka: Copy partitions / topics to disk Replay messages Inspect message

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