<div align="center">
# logly.rs
[](https://github.com/muhammad-fiaz/logly-rs/actions/workflows/rust.yml)
[](https://crates.io/crates/logly)
[](https://crates.io/crates/logly)
[](https://opensource.org/licenses/MIT)
[](https://crates.io/crates/logly)
[](https://opensource.org/licenses/MIT)
[](https://github.com/muhammad-fiaz/logly-rs/issues)
[](http://github.com/muhammad-fiaz/logly-rs/network)
[](http://github.com/muhammad-fiaz/logly-rs/stargazers)
[](https://github.com/muhammad-fiaz/logly-rs/blob/master/LICENSE)
[](https://github.com/muhammad-fiaz/logly-rs/graphs/contributors)
[](https://github.com/muhammad-fiaz/logly-rs/pulls)
[](https://github.com/muhammad-fiaz/logly-rs)
[](https://github.com/muhammad-fiaz)
[](https://github.com/sponsors/muhammad-fiaz)
</div>
Logly is a simple logging utility for rust that provides an easy way to log messages with different levels, colors, and options. It is designed to be flexible, allowing you to customize the log messages based on your application's needs. Logly supports logging to both the console and a file, and it comes with built-in color-coded log levels for better visibility.
if you like this project make sure to star 🌟 it in the [repository](https://github.com/muhammad-fiaz/logly-rs/) and if you want to contribute make sure to fork this repository❤✨.
## Installation
```shell
cargo add logly
```
### Usage
```rust
use logly::logly::*;
let logly = logly::new(); //intialize the logly
logly.start_logging("test_log.txt"); //start storing the log messages in txt, make sure to pass to create the file
logly.info("Key1", "Value1", LogColor::Cyan); // message with custom color if you don't want just set it None
logly.warn("Key2", "Value2", LogColor::Yellow);
logly.stop_logging(); //this will stop storing the message from here but it will display
logly.warn("Key3", "Value3", LogColor::Yellow);
```
## Color Options:
### Default Color Options:
| INFO | CYAN |
| WARNING | YELLOW |
| ERROR | RED |
| DEBUG | BLUE |
| CRITICAL | BRIGHT RED |
| TRACE | BLUE |
| DEFAULT | WHITE |
### Custom Color Options:
You can use any of the following color codes for custom coloring:
| CYAN | CYAN |
| YELLOW | YELLOW |
| RED | RED |
| BLUE | BLUE |
| BRIGHT RED | CRITICAL |
|WHITE | WHITE |
## Contributing
Contributions are welcome! Before contributing, please read our [Contributing Guidelines](CONTRIBUTING.md) to ensure a smooth and collaborative development process.
## Code of Conduct
Please review our [Code of Conduct](CODE_OF_CONDUCT.md) to understand the standards of behavior we expect from contributors and users of this project.
## License
This project is licensed under the [MIT License](). See [LICENSE](LICENSE) for more details.
## Support the Project
<br>
<div align="center">
<h5> <strong> 💰 You can help me improve more by offering a little support on any platform❤️</strong></h5>
[](https://buymeacoffee.com/muhammadfiaz) [](https://patreon.com/muhammadfiaz) [](https://ko-fi.com/muhammadfiaz)
[](https://github.com/sponsors/muhammad-fiaz)
[](https://opencollective.com/muhammadfiaz)
</div>
## Happy Coding ❤️