All Projects → rust-lang → Log

rust-lang / Log

Licence: other
Logging implementation for Rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Log

Reqray
Log call tree summaries after each request for rust programs instrumented with `tracing`.
Stars: ✭ 37 (-96.34%)
Mutual labels:  rust-library, logging
Log4jwebtracker
Java web tool to setup at runtime the log level of Log4j appenders in an application, and read the log at runtime.
Stars: ✭ 35 (-96.54%)
Mutual labels:  logging
Adenium
Adenium Normalizer
Stars: ✭ 29 (-97.13%)
Mutual labels:  logging
Lumberjack
A terminal-ui log watcher written in Go using the Flux architecture
Stars: ✭ 31 (-96.94%)
Mutual labels:  logging
Lme
An npm package to simply and beautifully log to console.
Stars: ✭ 29 (-97.13%)
Mutual labels:  logging
Photon
⚡ Rust/WebAssembly image processing library
Stars: ✭ 963 (-4.84%)
Mutual labels:  rust-library
Simulacrum
A small library for creating mock objects in Rust.
Stars: ✭ 21 (-97.92%)
Mutual labels:  rust-library
Fliplog
fluent logging with verbose insight, colors, tables, emoji, filtering, spinners, progress bars, timestamps, capturing, stack traces, tracking, presets, & more...
Stars: ✭ 41 (-95.95%)
Mutual labels:  logging
Logzero
Robust and effective logging for Python 2 and 3.
Stars: ✭ 977 (-3.46%)
Mutual labels:  logging
Nlog.xlogger
A C# .NET class library that extends NLog.Logger to provide additional functionality for tracing the entry and exit, arbitrary checkpoints, exceptions and stack traces within methods.
Stars: ✭ 31 (-96.94%)
Mutual labels:  logging
Testlogcollectors
A framework for capturing log statements during tests. Compatible with most popular logging frameworks. Works with JUnit and TestNG
Stars: ✭ 31 (-96.94%)
Mutual labels:  logging
Dotlog
Simple and easy go log framework
Stars: ✭ 30 (-97.04%)
Mutual labels:  logging
Arccstr
Thread-safe, reference-counted null-terminated immutable Rust strings.
Stars: ✭ 34 (-96.64%)
Mutual labels:  rust-library
Nim Morelogging
Logging library for Nim
Stars: ✭ 29 (-97.13%)
Mutual labels:  logging
Jsonpath Rs
JSONPath for Rust
Stars: ✭ 31 (-96.94%)
Mutual labels:  rust-library
Logging
Easy setup of clojure.tools.logging w/ SLF4j, plus request correlation
Stars: ✭ 21 (-97.92%)
Mutual labels:  logging
Loglevelnext
A modern logging library for Node.js that provides log level mapping to the console
Stars: ✭ 33 (-96.74%)
Mutual labels:  logging
Log4j2 Ttl Thread Context Map
🌳 Log4j2 TTL ThreadContextMap, Log4j2 extension integrated TransmittableThreadLocal to MDC
Stars: ✭ 41 (-95.95%)
Mutual labels:  logging
Tron
R package for easy logging
Stars: ✭ 38 (-96.25%)
Mutual labels:  logging
Finalfusion Rust
finalfusion embeddings in Rust
Stars: ✭ 35 (-96.54%)
Mutual labels:  rust-library

log

A Rust library providing a lightweight logging facade.

Build status Latest version Documentation License

A logging facade provides a single logging API that abstracts over the actual logging implementation. Libraries can use the logging API provided by this crate, and the consumer of those libraries can choose the logging implementation that is most suitable for its use case.

Minimum supported rustc

1.31.0+

This version is explicitly tested in CI and may be bumped in any release as needed. Maintaining compatibility with older compilers is a priority though, so the bar for bumping the minimum supported version is set very high. Any changes to the supported minimum version will be called out in the release notes.

Usage

In libraries

Libraries should link only to the log crate, and use the provided macros to log whatever information will be useful to downstream consumers:

[dependencies]
log = "0.4"
use log::{info, trace, warn};

pub fn shave_the_yak(yak: &mut Yak) {
    trace!("Commencing yak shaving");

    loop {
        match find_a_razor() {
            Ok(razor) => {
                info!("Razor located: {}", razor);
                yak.shave(razor);
                break;
            }
            Err(err) => {
                warn!("Unable to locate a razor: {}, retrying", err);
            }
        }
    }
}

In executables

In order to produce log output, executables have to use a logger implementation compatible with the facade. There are many available implementations to choose from, here are some of the most popular ones:

Executables should choose a logger implementation and initialize it early in the runtime of the program. Logger implementations will typically include a function to do this. Any log messages generated before the logger is initialized will be ignored.

The executable itself may use the log crate to log as well.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].