lambda-rs-logging 2023.1.30

Logging support for lambda-rs
Documentation
  • Coverage
  • 47.22%
    17 out of 36 items documented0 out of 22 items with examples
  • Size
  • Source code size: 9.76 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.27 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • vmarcella

lambda-rs-logging

A simple logger implementation for lamba-rs crates. Inspired by python's logging module.

Installation

First, add the following to your Cargo.toml:

[dependencies]
lambda-rs-logging = "2023.1.30"

or run this command from your project directory:

cargo add lambda-rs-logging

Getting started

Using the global logger

use logging;

fn main() {
  logging::trace!("Hello world");
  logging::debug!("Hello world");
  logging::info!("Hello world");
  logging::warn!("Hello world");
  logging::error!("Hello world");
  logging::fatal!("Hello world");
}

Using an instance of the logger

use logging::Logger;

fn main() {
  let logger = Logger::new("my-logger");
  logger.trace("Hello world");
  logger.debug("Hello world");
  logger.info("Hello world");
  logger.warn("Hello world");
  logger.error("Hello world");
  logger.fatal("Hello world");
}