pretty-loguru


Namepretty-loguru JSON
Version 1.1.3 PyPI version JSON
download
home_pageNone
SummaryA Loguru-based logger with Rich panels, ASCII art headers, blocks and more.
upload_time2025-07-22 14:54:11
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseMIT License Copyright (c) 2025 JonesHong Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Pretty-Loguru 🎨

[![Python Version](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
[![PyPI Version](https://img.shields.io/pypi/v/pretty-loguru.svg)](https://pypi.org/project/pretty-loguru/)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)

An enhanced Python logging library built on [Loguru](https://github.com/Delgan/loguru), integrating [Rich](https://github.com/Textualize/rich) and ASCII art to make logging more elegant and intuitive.

## ✨ Features

- 🎨 **Rich Block Logging** - Display structured logs using Rich panels
- 🎯 **ASCII Art Headers** - Generate eye-catching ASCII art titles
- 🔥 **One-Click Setup** - Simple configuration for both file and console logging
- 🚀 **FastAPI Integration** - Perfect integration with FastAPI and Uvicorn
- 📊 **Preset Configurations** - Best practices for development, production, and testing
- 🛠️ **Highly Customizable** - Support for custom formats, colors, and rotation strategies

## 📦 Installation

```bash
pip install pretty-loguru
```

## 🚀 Quick Start

### Basic Usage

```python
from pretty_loguru import create_logger

# Create logger
logger = create_logger("my_app")

# Basic logging
logger.info("Application started")
logger.success("Operation completed successfully")
logger.warning("This is a warning")
logger.error("An error occurred")

# Rich blocks
logger.block("System Status", "Everything is running smoothly", border_style="green")

# ASCII art
logger.ascii_header("WELCOME", font="slant")
```

### Using Configuration Objects

```python
from pretty_loguru import create_logger, LoggerConfig, ConfigTemplates

# Use preset templates
config = ConfigTemplates.production()
logger = create_logger("app", config=config)

# Custom configuration
custom_config = LoggerConfig(
    level="DEBUG",
    log_path="logs",
    rotation="1 day",
    retention="7 days"
)
logger = create_logger("debug_app", config=custom_config)

# Update existing logger
config.update(level="INFO")  # All loggers using this config will update
```

### Multi-Logger Management

```python
# Create multiple loggers
auth_logger = create_logger("auth", level="INFO")
db_logger = create_logger("database", level="DEBUG")
api_logger = create_logger("api", level="WARNING")

# Unified configuration management
config = LoggerConfig(level="INFO", log_path="logs")
loggers = config.apply_to("auth", "database", "api")

# Dynamic update for all loggers
config.update(level="DEBUG")  # All loggers update simultaneously
```

## 📖 Documentation

Full documentation available at: [https://joneshong.github.io/pretty-loguru/](https://joneshong.github.io/pretty-loguru/)

- [User Guide](docs/en/guide/index.md)
- [API Reference](docs/en/api/index.md)
- [Examples](examples/README.md)
- [Configuration Guide](docs/en/guide/custom-config.md)

## 🤝 Contributing

Issues and Pull Requests are welcome!

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pretty-loguru",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "JonesHong <latte831104@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/fd/e8/bb3c053a5bb63d2260c131add8a0fb381d7f7c57e455cf0d1b5df3552fb9/pretty_loguru-1.1.3.tar.gz",
    "platform": null,
    "description": "# Pretty-Loguru \ud83c\udfa8\n\n[![Python Version](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)\n[![PyPI Version](https://img.shields.io/pypi/v/pretty-loguru.svg)](https://pypi.org/project/pretty-loguru/)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)\n\nAn enhanced Python logging library built on [Loguru](https://github.com/Delgan/loguru), integrating [Rich](https://github.com/Textualize/rich) and ASCII art to make logging more elegant and intuitive.\n\n## \u2728 Features\n\n- \ud83c\udfa8 **Rich Block Logging** - Display structured logs using Rich panels\n- \ud83c\udfaf **ASCII Art Headers** - Generate eye-catching ASCII art titles\n- \ud83d\udd25 **One-Click Setup** - Simple configuration for both file and console logging\n- \ud83d\ude80 **FastAPI Integration** - Perfect integration with FastAPI and Uvicorn\n- \ud83d\udcca **Preset Configurations** - Best practices for development, production, and testing\n- \ud83d\udee0\ufe0f **Highly Customizable** - Support for custom formats, colors, and rotation strategies\n\n## \ud83d\udce6 Installation\n\n```bash\npip install pretty-loguru\n```\n\n## \ud83d\ude80 Quick Start\n\n### Basic Usage\n\n```python\nfrom pretty_loguru import create_logger\n\n# Create logger\nlogger = create_logger(\"my_app\")\n\n# Basic logging\nlogger.info(\"Application started\")\nlogger.success(\"Operation completed successfully\")\nlogger.warning(\"This is a warning\")\nlogger.error(\"An error occurred\")\n\n# Rich blocks\nlogger.block(\"System Status\", \"Everything is running smoothly\", border_style=\"green\")\n\n# ASCII art\nlogger.ascii_header(\"WELCOME\", font=\"slant\")\n```\n\n### Using Configuration Objects\n\n```python\nfrom pretty_loguru import create_logger, LoggerConfig, ConfigTemplates\n\n# Use preset templates\nconfig = ConfigTemplates.production()\nlogger = create_logger(\"app\", config=config)\n\n# Custom configuration\ncustom_config = LoggerConfig(\n    level=\"DEBUG\",\n    log_path=\"logs\",\n    rotation=\"1 day\",\n    retention=\"7 days\"\n)\nlogger = create_logger(\"debug_app\", config=custom_config)\n\n# Update existing logger\nconfig.update(level=\"INFO\")  # All loggers using this config will update\n```\n\n### Multi-Logger Management\n\n```python\n# Create multiple loggers\nauth_logger = create_logger(\"auth\", level=\"INFO\")\ndb_logger = create_logger(\"database\", level=\"DEBUG\")\napi_logger = create_logger(\"api\", level=\"WARNING\")\n\n# Unified configuration management\nconfig = LoggerConfig(level=\"INFO\", log_path=\"logs\")\nloggers = config.apply_to(\"auth\", \"database\", \"api\")\n\n# Dynamic update for all loggers\nconfig.update(level=\"DEBUG\")  # All loggers update simultaneously\n```\n\n## \ud83d\udcd6 Documentation\n\nFull documentation available at: [https://joneshong.github.io/pretty-loguru/](https://joneshong.github.io/pretty-loguru/)\n\n- [User Guide](docs/en/guide/index.md)\n- [API Reference](docs/en/api/index.md)\n- [Examples](examples/README.md)\n- [Configuration Guide](docs/en/guide/custom-config.md)\n\n## \ud83e\udd1d Contributing\n\nIssues and Pull Requests are welcome!\n\n## \ud83d\udcc4 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2025 JonesHong\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.\n        \n        ",
    "summary": "A Loguru-based logger with Rich panels, ASCII art headers, blocks and more.",
    "version": "1.1.3",
    "project_urls": {
        "Source": "https://github.com/JonesHong/pretty-loguru",
        "Tracker": "https://github.com/JonesHong/pretty-loguru/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4d8bb595d94531e9ec0505796fcbe7e3b49be9e2262de1cfcc5fe469e3638bc8",
                "md5": "dc72241ec544768a0104c7c1ed7ad492",
                "sha256": "3001accc0d3def92b587e35f45110047d5bb7a456a14c5b5862ff2a6dbd98dfe"
            },
            "downloads": -1,
            "filename": "pretty_loguru-1.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dc72241ec544768a0104c7c1ed7ad492",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 71129,
            "upload_time": "2025-07-22T14:54:09",
            "upload_time_iso_8601": "2025-07-22T14:54:09.404798Z",
            "url": "https://files.pythonhosted.org/packages/4d/8b/b595d94531e9ec0505796fcbe7e3b49be9e2262de1cfcc5fe469e3638bc8/pretty_loguru-1.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "fde8bb3c053a5bb63d2260c131add8a0fb381d7f7c57e455cf0d1b5df3552fb9",
                "md5": "0931cbf5abeae41e744cbd3d9374e4a6",
                "sha256": "18095e501ca843ea4f8ce18f9914a63fbb1994f11b03419fa43c412ae293a5d4"
            },
            "downloads": -1,
            "filename": "pretty_loguru-1.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "0931cbf5abeae41e744cbd3d9374e4a6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 57927,
            "upload_time": "2025-07-22T14:54:11",
            "upload_time_iso_8601": "2025-07-22T14:54:11.573637Z",
            "url": "https://files.pythonhosted.org/packages/fd/e8/bb3c053a5bb63d2260c131add8a0fb381d7f7c57e455cf0d1b5df3552fb9/pretty_loguru-1.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-22 14:54:11",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "JonesHong",
    "github_project": "pretty-loguru",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pretty-loguru"
}
        
Elapsed time: 0.60211s