1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! A bunch of utilities for the packxel project.
//!
//! ## Initializer
//! ```
//! use packxel_utils::initializer::Initializer;
//!
//! let version = env!("CARGO_PKG_VERSION");
//! // creates the config and log directories.
//! let initializer = Initializer::init("package-name", version);
//! // the above would create $HOME/.config/package-name
//! // and logs at $HOME/.config/package-name/logs
//! ```
//!
//! ## Logging
//! ```
//! PackxelLogger::init(initializer).unwrap();
//! // The use log crate from rust-lang
//! // Writes to $HOME/.config/package-name/logs/packxel.log
//! // where `package-name` is initializer.name.
//! log::debug!("Hello World!");
//! // Run with RUST_LOG=debug cargo run
//! ```
//!
/// This is the main library for the packxel-utils crate.
/// It contains the Initializer struct which is used to initialize
/// This should be called before any program is initialized.
/// An optional logging module for the packxel-utils crate.
/// This should be called after the initializer is initialized.