Crates.io | loggs |
lib.rs | loggs |
version | 0.1.0 |
source | src |
created_at | 2022-12-05 19:02:07.569531 |
updated_at | 2022-12-05 19:02:07.569531 |
description | A simple opinionated logger for Windows and Linux applications |
homepage | |
repository | https://github.com/lukas0008/loggs |
max_upload_size | |
id | 730541 |
size | 5,006 |
Simple opinionated logger for Windows and Linux applications
use loggs::Logger;
fn main() {
let logger = Logger::new_default_location("testapp");
// Add a log `Hello logs!` inside of a collection of logs named `main_app`
logger.log("main_app", "Hello logs!");
// Save logs explicitly
logger.save_logs();
// This will make it so if your app panics, the logs will be saved
logger.save_on_panic();
}
The above code will create the following file structure:
on Windows - %AppData%/[app_name]/Logs/[current_time]/main_app.log.txt
on Linux - /var/log/[app_name]/[current_time]/main_app.log.txt