| Crates.io | smlog |
| lib.rs | smlog |
| version | 0.1.4 |
| created_at | 2024-11-19 00:13:01.007631+00 |
| updated_at | 2024-11-19 18:36:48.89953+00 |
| description | A very basic stdout logging implementation |
| homepage | |
| repository | https://github.com/cartercanedy/smlog |
| max_upload_size | |
| id | 1452769 |
| size | 5,988 |
Useful for basic human-readable logging, and not much else
Rather than other logging implementations, this logger is extremely opinionated for the sake of
simplicity. The lack of choice means that you should be able to call smlog::Log::init(...)
once in main and immediately start logging using log's logging macros, without adding a
significant amount of bloat to your project.
Your log statements will look extremely basic:
info!(...) prints info: ...warn!(...) prints warning: ...error!(...) prints error: ...debug!(...) prints debug: ...trace!(...) prints trace: ...but sometimes, that's all you really need.
use smlog::{log::{info, error}, Log, LevelFilter};
fn main() {
Log::init(LevelFilter::Info);
info!("Hello, world!");
// Outputs `info: Hello, world!`
error!("Goodbye, world!");
// Outputs `error: Goodbye, world!`
}