Crates.io | lambda-rs-logging |
lib.rs | lambda-rs-logging |
version | 2023.1.30 |
source | src |
created_at | 2023-01-31 01:22:21.314107 |
updated_at | 2023-01-31 01:22:21.314107 |
description | Logging support for lambda-rs |
homepage | |
repository | |
max_upload_size | |
id | 772266 |
size | 10,069 |
A simple logger implementation for lamba-rs crates. Inspired by python's logging module.
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
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");
}
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");
}