3 unstable releases

Uses new Rust 2021

0.2.0 Sep 6, 2022
0.1.1 Sep 4, 2022
0.1.0 Sep 4, 2022

#182 in Debugging

Download history 75/week @ 2022-09-01 51/week @ 2022-09-08 70/week @ 2022-09-15

196 downloads per month
Used in 2 crates

MIT license

5KB

crates.io Crates.io docs.rs

Simple File Logger

A simple file logger for rust.

Very basic setup, just provide an app name and an optional log level.

use simple_file_logger::{init_logger, LogLevel};
use log::info;

fn main() {
    init_logger("my_app", Loglevel::IDK);
    info!("Hello, world!");
}

The log levels are: trace, debug, (info, IDK), warn, error.

The log file is located:

OS Path Example
Windows %FOLDERID_LocalAppData%\program_name\log\program_nametime_stamp.log C:\Users\username\AppData\Local\program_name\log\program_name_2020-05-01T12-34-56.log
Linux $XDG_DATA_HOME/program_name/log/program_name_time_stamp.log /home/username/.local/share/program_name/log/program_name_2020-05-01T12-34-56.log
macOS $HOME/Library/Application Support/program_name/log/program_nametime_stamp.log Users/username/Library/Application Support/program_name/log/program_name_2020-05-01T12-34-56.log

Dependencies

~1.2–1.7MB
~34K SLoC