{"id":15837913,"url":"https://github.com/muhammad-fiaz/logly-rs","last_synced_at":"2025-11-09T11:02:52.831Z","repository":{"id":214074971,"uuid":"735631553","full_name":"muhammad-fiaz/logly-rs","owner":"muhammad-fiaz","description":"Logly is a rust logging package designed to simplify and enhance your logging experience.","archived":false,"fork":false,"pushed_at":"2025-11-03T16:15:40.000Z","size":181,"stargazers_count":2,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-03T16:17:49.492Z","etag":null,"topics":["cargo","cargo-make","lib","library","log","log-rust","logging","logging-example","logging-framework","logging-library","logging-rust","logly","logly-rs","rs","rust","rust-lang","rust-lib","rust-library","rust-log","rust-logs"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/logly","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/muhammad-fiaz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["muhammad-fiaz"]}},"created_at":"2023-12-25T16:03:33.000Z","updated_at":"2025-11-03T16:12:51.000Z","dependencies_parsed_at":"2024-06-12T16:59:54.069Z","dependency_job_id":null,"html_url":"https://github.com/muhammad-fiaz/logly-rs","commit_stats":{"total_commits":39,"total_committers":2,"mean_commits":19.5,"dds":0.02564102564102566,"last_synced_commit":"a4cb3bf224694b2ab74e068e1eb33ce82d9e82c5"},"previous_names":["muhammad-fiaz/logly-rs"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/muhammad-fiaz/logly-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammad-fiaz%2Flogly-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammad-fiaz%2Flogly-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammad-fiaz%2Flogly-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammad-fiaz%2Flogly-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muhammad-fiaz","download_url":"https://codeload.github.com/muhammad-fiaz/logly-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammad-fiaz%2Flogly-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283496071,"owners_count":26845317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-09T02:00:05.828Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cargo","cargo-make","lib","library","log","log-rust","logging","logging-example","logging-framework","logging-library","logging-rust","logly","logly-rs","rs","rust","rust-lang","rust-lib","rust-library","rust-log","rust-logs"],"created_at":"2024-10-05T15:42:26.412Z","updated_at":"2025-11-09T11:02:52.825Z","avatar_url":"https://github.com/muhammad-fiaz.png","language":"Rust","funding_links":["https://github.com/sponsors/muhammad-fiaz"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"https://github.com/user-attachments/assets/565fc3dc-dd2c-47a6-bab6-2f545c551f26\" alt=\"logly logo\" width=\"400\" /\u003e\n\n[![Crates.io](https://img.shields.io/crates/v/logly)](https://crates.io/crates/logly)\n[![Documentation](https://docs.rs/logly/badge.svg)](https://docs.rs/logly)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Build Status](https://github.com/muhammad-fiaz/logly-rs/workflows/CI/badge.svg)](https://github.com/muhammad-fiaz/logly-rs/actions)\n[![Rust](https://img.shields.io/badge/rust-1.70%2B-orange.svg)](https://www.rust-lang.org/)\n[![GitHub stars](https://img.shields.io/github/stars/muhammad-fiaz/logly-rs)](https://github.com/muhammad-fiaz/logly-rs)\n[![GitHub issues](https://img.shields.io/github/issues/muhammad-fiaz/logly-rs)](https://github.com/muhammad-fiaz/logly-rs/issues)\n[![GitHub pull requests](https://img.shields.io/github/issues-pr/muhammad-fiaz/logly-rs)](https://github.com/muhammad-fiaz/logly-rs/pulls)\n[![GitHub last commit](https://img.shields.io/github/last-commit/muhammad-fiaz/logly-rs)](https://github.com/muhammad-fiaz/logly-rs)\n\n\u003cp\u003e\u003cem\u003eHigh-performance, production-ready structured logging library for Rust\u003c/em\u003e\u003c/p\u003e\n\n**📚 [Documentation](https://muhammad-fiaz.github.io/logly-rs/) | [API Reference](https://docs.rs/logly) | [Quick Start](docs/QUICK_START.md)**\n\n\u003c/div\u003e\n\n---\n\n## Overview\n\nlogly-rs is a high-performance, production-ready structured logging library for Rust with async support, GPU acceleration, rotation, filtering, callbacks, and comprehensive error handling.\n\n### 🚀 Core Features\n\n- **8 Log Levels**: TRACE (5), DEBUG (10), INFO (20), SUCCESS (25), WARNING (30), ERROR (40), FAIL (45), CRITICAL (50)\n- **Custom Log Levels**: Add your own levels with custom priorities and colors\n- **Structured Logging**: JSON and custom format support\n- **Context Binding**: Persistent and temporary context fields\n- **Out-of-Box Ready**: Works immediately with auto-sink enabled by default\n\n### ⚡ Performance \u0026 Scalability\n\n- **Async Logging**: Non-blocking writes with configurable buffers\n- **GPU/CUDA Support**: Optional GPU acceleration (compile with `--features gpu`)\n- **Thread-Safe**: Lock-free operations with concurrent logging support\n- **Zero-Copy**: Efficient memory management\n- **High Throughput**: 13,000+ operations per second\n\n### 📝 Output Management\n\n- **Multiple Sinks**: Console, file, and custom outputs\n- **Auto-Sinks**: Automatic sink initialization (enabled by default)\n- **Manual Sink Management**: Full control over sink lifecycle\n- **File Rotation**: Time-based (hourly, daily, weekly, monthly, yearly) and size-based rotation\n- **Retention Policies**: Automatic cleanup of old log files\n- **Global Controls**: Enable/disable console display and file storage globally\n\n### 🔧 Filtering \u0026 Formatting\n\n- **Level Filtering**: Filter by minimum log level\n- **Module/Function Filtering**: Target specific code sections\n- **Custom Formatters**: Template-based formatting with placeholders\n- **Colored Output**: ANSI colors with custom color callbacks\n- **Custom Time Formats**: YYYY-MM-DD HH:mm:ss.SSS patterns\n\n### 🎯 Advanced Features\n\n- **Callbacks**: Log callbacks, color callbacks, exception callbacks\n- **Exception Handling**: Comprehensive error handling with backtraces\n- **Auto-Update Check**: Checks for new versions automatically (enabled by default)\n- **Debug Mode**: Detailed internal logging for troubleshooting\n- **Runtime Configuration**: Change all settings at runtime\n- **Enable/Disable**: Toggle logging on/off without removing sinks\n\n## Installation\n\nAdd to your `Cargo.toml`:\n\n```toml\n[dependencies]\nlogly = \"0.0.4\"\n\n# With GPU support (experimental)\nlogly = { version = \"0.0.4\", features = [\"gpu\"] }\n```\n\n## Quick Start\n\n```rust\nuse logly::prelude::*;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let logger = Logger::new();\n    logger.add_sink(SinkConfig::default())?;\n    \n    logger.info(\"Application started\".to_string())?;\n    logger.success(\"Operation completed!\".to_string())?;\n    logger.warning(\"Warning message\".to_string())?;\n    logger.error(\"Error occurred\".to_string())?;\n    \n    Ok(())\n}\n```\n\n## Performance Benchmarks\n\nReal benchmark results from criterion (measured on your system):\n\n| Operation | Average Time | Throughput | Notes |\n|-----------|--------------|------------|-------|\n| Basic INFO log | 75.6 μs | 13,200 ops/sec | Single message to console |\n| File logging | ~150 μs | 6,600 ops/sec | With async write |\n| With context | ~130 μs | 7,700 ops/sec | 2-3 bound fields |\n| Concurrent (10 threads) | ~500 μs | 2,000 ops/sec | 10 threads × 100 messages |\n| Multiple sinks (5) | ~200 μs | 5,000 ops/sec | Console + 4 files |\n| TRACE level | ~74 μs | 13,500 ops/sec | Fastest level |\n| DEBUG level | ~75 μs | 13,300 ops/sec | |\n| INFO level | ~76 μs | 13,200 ops/sec | |\n| WARNING level | ~75 μs | 13,300 ops/sec | |\n| ERROR level | ~76 μs | 13,200 ops/sec | |\n\n*Benchmarks run with criterion on Windows. Times include formatting, serialization, and I/O.*\n\n### Performance Characteristics\n\n- **Memory**: \u003c1MB base overhead\n- **CPU**: Minimal impact with async writes\n- **Latency**: Sub-millisecond for most operations\n- **Scalability**: Linear scaling up to 10 threads\n\nSee [Performance Guide](docs/PERFORMANCE.md) for optimization techniques.\n\n## Platform Support\n\n- ✅ **Windows**: Full support (tested on Windows 11)\n- ✅ **Linux**: Full support (Ubuntu 20.04+)\n- ✅ **macOS**: Full support (macOS 11+)\n- ⚠️ **GPU**: Requires CUDA toolkit (Linux/Windows only)\n\n## Advanced Usage\n\n### File Logging with Rotation\n\n```rust\nuse logly::prelude::*;\nuse std::path::PathBuf;\n\nlet logger = Logger::new();\n\nlet config = SinkConfig {\n    path: Some(PathBuf::from(\"logs/app.log\")),\n    rotation: Some(\"daily\".to_string()),\n    size_limit: Some(10 * 1024 * 1024), // 10MB\n    retention: Some(7), // Keep 7 files\n    async_write: true,\n    ..Default::default()\n};\n\nlogger.add_sink(config)?;\n```\n\n### Custom Log Levels\n\n```rust\n// Add custom level with priority between WARNING (30) and ERROR (40)\nlogger.add_custom_level(\"NOTICE\".to_string(), 35, \"96\".to_string())?;\n\n// Use custom level\nlogger.log_custom(\"NOTICE\", \"Custom level message\".to_string())?;\n```\n\n### Callbacks\n\n```rust\n// Log callback for monitoring\nlogger.add_log_callback(|record| {\n    if record.level \u003e= Level::Error {\n        println!(\"High severity: {}\", record.message);\n    }\n    Ok(())\n});\n\n// Custom color callback\nlogger.add_color_callback(|level, message| {\n    format!(\"\\x1b[1m[{}]\\x1b[0m {}\", level.as_str(), message)\n});\n\n// Exception callback\nlogger.add_exception_callback(|error, backtrace| {\n    eprintln!(\"Exception: {}\\n{}\", error, backtrace);\n});\n```\n\n### Context Binding\n\n```rust\n// Bind persistent context\nlogger.bind(\"user_id\".to_string(), serde_json::json!(\"12345\"));\nlogger.bind(\"session\".to_string(), serde_json::json!(\"abc-def\"));\n\nlogger.info(\"User action logged\".to_string())?;\n\n// Remove binding\nlogger.unbind(\"user_id\");\n\n// Clear all bindings\nlogger.clear_bindings();\n```\n\n### GPU Acceleration\n\n```rust\nlet mut config = LoggerConfig::default();\nconfig.enable_gpu = true;\nconfig.gpu_buffer_size = 2 * 1024 * 1024; // 2MB\n\nlogger.configure(config);\nlogger.enable_gpu()?;\n\nprintln!(\"{}\", logger.gpu_info());\n```\n\n## Configuration\n\n### Basic Configuration\n\n```rust\nlet mut config = LoggerConfig::default();\nconfig.level = Level::Debug;\nconfig.color = true;\nconfig.json = false;\nlogger.configure(config);\n```\n\n### Configuration File\n\nCreate `logly.toml`:\n\n```toml\n[logly.configuration]\nlevel = \"DEBUG\"\nauto_sink = true\n\n[logly.display]\ncolor = true\nglobal_console_display = true\nglobal_file_storage = true\n\n[logly.features]\nenable_callbacks = true\nenable_exception_handling = true\nenable_version_check = true\n```\n\nSee [Configuration Guide](docs/CONFIGURATION.md) for all options.\n\n## Documentation\n\nFull documentation available at: https://muhammad-fiaz.github.io/logly-rs\n\n### Getting Started\n\n- [Installation Guide](docs/INSTALLATION.md) - Complete installation instructions\n- [Quick Start](docs/QUICK_START.md) - Get started in minutes\n- [Configuration Guide](docs/CONFIGURATION.md) - Complete configuration reference\n\n### Feature Guides\n\n- [Log Levels](docs/guides/LEVELS.md) - All 8 levels and custom levels\n- [Sinks](docs/guides/SINKS.md) - Multiple sinks, auto-sinks, manual management\n- [Rotation \u0026 Retention](docs/guides/ROTATION.md) - File rotation (hourly to yearly)\n- [Configuration File](docs/guides/CONFIG_FILE.md) - logly.toml support\n- [Template Formatting](docs/guides/FORMATTING.md) - Custom time formats and placeholders\n- [Callbacks](docs/guides/CALLBACKS.md) - Log, color, and exception callbacks\n- [GPU Support](docs/guides/GPU.md) - GPU/CUDA acceleration\n- [Troubleshooting](docs/guides/TROUBLESHOOTING.md) - Common issues and solutions\n- [Performance](docs/PERFORMANCE.md) - Optimization techniques\n\n### Project Information\n\n- [Changelog](docs/CHANGELOG.md) - Release history and changes\n- [Contributing](CONTRIBUTING.md) - How to contribute\n- [License](LICENSE) - MIT License\n- [Code of Conduct](CODE_OF_CONDUCT.md) - Community guidelines\n\n## Examples\n\nRun the examples:\n\n```bash\n# Basic usage\ncargo run --example basic\n\n# Advanced features\ncargo run --example advanced\n\n# Complete configuration\ncargo run --example configuration\n\n# GPU logging (requires CUDA)\ncargo run --example gpu_logging --features gpu\n\n# Callbacks and custom colors\ncargo run --example callbacks\n\n# File rotation\ncargo run --example rotation\n\n# Custom log levels\ncargo run --example custom_levels\n```\n\n## Testing\n\n```bash\n# Run all tests\ncargo test\n\n# Run with output\ncargo test -- --nocapture\n\n# Run specific test\ncargo test test_level_priority\n\n# Run benchmarks\ncargo bench\n```\n\n## Error Reporting\n\nIf you encounter any bugs or issues:\n\n- **Rust crate**: https://github.com/muhammad-fiaz/logly-rs/issues\n- **Python package**: https://github.com/muhammad-fiaz/logly/issues\n\n## Contributing\n\nContributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Repository\n\n- **Rust**: https://github.com/muhammad-fiaz/logly-rs\n- **Python**: https://github.com/muhammad-fiaz/logly\n\n## Version\n\nCurrent version: **0.0.4**\n\nSee [CHANGELOG.md](docs/CHANGELOG.md) for release history.\n\nCheck for updates:\n```rust\nif let Ok(Some(msg)) = logger.check_version() {\n    println!(\"{}\", msg);\n}\n```\n\n## Author\n\nmuhammad-fiaz\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n[![Star History Chart](https://api.star-history.com/svg?repos=muhammad-fiaz/logly-rs\u0026type=Date\u0026bg=transparent)](https://github.com/muhammad-fiaz/logly-rs/)\n\n**⭐ Star the repository if you find logly-rs useful!**\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhammad-fiaz%2Flogly-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuhammad-fiaz%2Flogly-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhammad-fiaz%2Flogly-rs/lists"}