talira

A lightweight logging facade for Rust

open sourceMIT OR Apache-2.0free

log is the Rust project's lightweight logging facade: one logging API (the error!, warn!, info!, debug! and trace! macros) that libraries call, while the executable picks the logger implementation that writes the output, such as env_logger, simple_logger or a system logger. With no logger set, log calls do nothing. It lives in the rust-lang organization on GitHub.

Problems it solves

  • log from my Rust library without choosing a logger for the app that uses it
  • add logging macros to a Rust crate
  • let a Rust binary choose how its dependencies' log messages are written
  • a standard logging API for Rust

Features

  • error!, warn!, info!, debug! and trace! macros
  • libraries log, executables choose the logger
  • many logger implementations, env_logger among them
  • no-op when no logger is set