https://github.com/krishpranav/rustlog
A cool log library built using rust-lang
https://github.com/krishpranav/rustlog
cargo crate git library log logger logging rust rustlang
Last synced: 6 months ago
JSON representation
A cool log library built using rust-lang
- Host: GitHub
- URL: https://github.com/krishpranav/rustlog
- Owner: krishpranav
- License: gpl-2.0
- Created: 2022-07-20T13:15:38.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-07-20T13:47:53.000Z (almost 4 years ago)
- Last Synced: 2025-03-04T13:46:30.080Z (over 1 year ago)
- Topics: cargo, crate, git, library, log, logger, logging, rust, rustlang
- Language: Rust
- Homepage:
- Size: 11.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## RustLog
- A cool log library built using rust-lang
## Installation:
- Cargo.toml
```toml
rustlog = { git = "https://github.com/krishpranav/rustlog" }
log = "0.4.17"
```
## Usage:
- trace log:
```rust
#[macro_use]
extern crate log;
extern crate rustlog;
fn main() {
rustlog::init_from_env("LOG_LEVEL");
trace!("Trace details");
}
```
- debug log:
```rust
#[macro_use]
extern crate log;
extern crate rustlog;
fn main() {
rustlog::init_from_env("LOG_LEVEL");
debug!("Debug details.");
}
```
- info log:
```rust
#[macro_use]
extern crate log;
extern crate rustlog;
fn main() {
rustlog::init_from_env("LOG_LEVEL");
info!("information.");
}
```
- warn log:
```rust
#[macro_use]
extern crate log;
extern crate rustlog;
fn main() {
rustlog::init_from_env("LOG_LEVEL");
warn!("warning.");
}
```
- error log:
```rust
#[macro_use]
extern crate log;
extern crate rustlog;
fn main() {
rustlog::init_from_env("LOG_LEVEL");
error!("errorr!!!!!.");
}
```
## License:
- rustlog is licensed under [GPL-2.0 License](https://github.com/krishpranav/rustlog/blob/master/LICENSE)