easylog 1.0.2

A simple and easy to use logging-crate. Write log-messages to a file.
docs.rs failed to build easylog-1.0.2
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: easylog-2.0.1

Latest version Documentation License

Note:

Only tested on Linux!

Example

extern crate easylog;

use easylog::{LogFile, LogFileConfig, LogLevel};

fn main() {
    let default = LogFileConfig::new();
    let mut logfile = match LogFile::new(default) {
        Ok(file) => file,
        Err(error) => panic!("Error: {}", error),
    };

    logfile.write(LogLevel::DEBUG, "Insert your logmessage here...");
    logfile.write(LogLevel::INFO, "Insert your logmessage here...");
    logfile.write(LogLevel::WARNING, "Insert your logmessage here...");
    logfile.write(LogLevel::ERROR, "Insert your logmessage here...");
    logfile.write(LogLevel::CRITICAL, "Insert your logmessage here...");
}

Example Output in ./logfile_0.log

2018-06-09 22:51:37.443883  [DEBUG   ]  Insert your logmessage here...
2018-06-09 22:51:37.443969  [INFO    ]  Insert your logmessage here...
2018-06-09 22:51:37.443996  [WARNING ]  Insert your logmessage here...
2018-06-09 22:51:37.444022  [ERROR   ]  Insert your logmessage here...
2018-06-09 22:51:37.444048  [CRITICAL]  Insert your logmessage here...