#logging #write-file #console #lunar #env-logger #info

lunar-logger

Simple logger with write to file functionality

5 releases

0.2.1 Aug 10, 2024
0.2.0 Jun 20, 2024
0.1.2 May 22, 2024
0.1.1 May 12, 2024
0.1.0 May 11, 2024

#357 in WebAssembly

MIT license

17KB
368 lines

lunar-logger

Simple logger, that can.. well... log stuff, both to console and to a file.

Works mostly like env_logger, except configured entirely from code and can write to files by itself. Also supports logging on wasm.

Usage:

   use lunar_logger::Logger;

   let mut logger = Logger::new();

   logger.add_filter("wgpu", lunar_logger::FilterType::Crate, log::LevelFilter::Warn);
   logger.set_default_filter(log::LevelFilter::Info);
   logger.enable_logger();

   log::info!("It works!");

lib.rs:

lunar-logging

Simple logger, that can.. well... log stuff, both to console and to a file.

Works mostly like env_logger, except configured entirely from code and can write to files by itself.

Usage:

use lunar_logger::Logger;

let mut logger = Logger::new();

logger.add_filter("wgpu", lunar_logger::FilterType::Crate, log::LevelFilter::Warn);
logger.set_default_filter(log::LevelFilter::Info);
logger.enable_logger();

log::info!("It works!");

Dependencies

~1–3.5MB
~62K SLoC