<p align="center">
<img src="https://raw.githubusercontent.com/rlapine/detaillogger/refs/heads/main/assets/detaillogger_logo_2.png" alt="DetailLogger logo" width="400"/>
</p>
---
## π¨ DetailLogger V 0.1.4
---
[](https://www.python.org/downloads/)
[](LICENSE)
[](https://github.com/rlapine/detaillogger/stargazers)
[](https://github.com/rlapine/detaillogger/network/members)
---
## β¨ Overview
DetailLogger is a lightweight Python utility for enhanced logging and exception tracing. It automatically captures contextual informationβsuch as file name, function, and line numberβwhenever messages or exceptions are logged. Ideal for debugging, monitoring, and building maintainable systems.
---
## π¦ Installation
`pip install detaillogger`
---
## βοΈ Features
- β
Logs messages with caller context
- β
Captures exceptions with full traceback
- β
Supports console and file-based logging
- β
Uses wrapper functions for quick integration
- β
Built entirely on standard libraries
---
## βοΈ API Overview
- `DetailLogger(level, fmt, file_name)`: Create an instance with optional file output and log level
- `log(message: str)`: Logs message with caller metadata
- `log_exception(ex: BaseException, details: Optional[str])`: Logs exception type, message, optional details, and source context
---
## π§ͺ Usage
# Run the built-in CLI demo for testing:
`python detaillogger.py`
# Embedded Example
```
from detaillogger import log, log_exception
log("This is a message to log.")
try:
x = 1 / 0
except Exception as e:
log_exception(e, details="This is a message about the exception to log.")
```
**Console Output:**
```
2025-07-28 17:02:27,674 - DEBUG - Details: This is a message to log.
2025-07-28 17:02:27,674 - DEBUG - From: c:\Users\ryan\...detaillogger.py
2025-07-28 17:02:27,675 - DEBUG - Function: main()
2025-07-28 17:02:27,675 - DEBUG - Line: 3
2025-07-28 17:05:22,185 - DEBUG - Exception type: ZeroDivisionError
2025-07-28 17:05:22,186 - DEBUG - Exception message: division by zero
2025-07-28 17:05:22,186 - DEBUG - Details: This is a message about the exception to log.
2025-07-28 17:05:22,186 - DEBUG - File: ...detaillogger.py
2025-07-28 17:05:22,186 - DEBUG - Function: main()
2025-07-28 17:05:22,186 - DEBUG - Line: 6
```
# Embedded Example
```
# To log to a file and console, instantiate DetailLogger class with filename.
from detaillogger import log, log_exception
logger = DetailLogger(file_name="detail.log")
log("This is a message to log to file.")
try:
x = 1 / 0
except Exception as e:
log_exception(e, details="This is a message about the exception to log to file.")
```
**File Output:**

---
## π§ Built-in demo:
`python detaillogger.py`
```
Also log to file? (y/n):y
Enter filname:detail.log
Options
1) Log details.
2) Log 'division by zero' exception.
3) Log custom exception.
q) Exit.
Enter an option:1
Enter message to log:This is a message.
2025-07-30 14:46:04,161 - DEBUG - Details: This is a message.
2025-07-30 14:46:04,161 - DEBUG - From: c:\Users\ryan\Visual Code Projects\git_repositories\detaillogger\detaillogger.py
2025-07-30 14:46:04,162 - DEBUG - Function: main()
2025-07-30 14:46:04,162 - DEBUG - Line: 179
Message logged.
```
---
## π§± File Structure
```
detaillogger/
βββ detaillogger.py # Core module
βββ test_detaillogger.py # Unit test suite
βββ assets/ # Folder for images, badges, or other static assets
β βββ detaillogger_logo_2.png # Logo for documentation
β βββ image.png # File output
βββ README.md # Documentation
βββ detaillogger.log # Optional output log file
```
---
## π€ Contributing
Pull requests are welcome! For major changes, open an issue to discuss improvements first.
---
## π License
This project is licensed under the [MIT License](LICENSE).
---
## π€ Author
Created by Ryan LaPine [@rlapine](https://github.com/rlapine) β a technically skilled developer focused on clarity, maintainability, and audience-ready documentation. This class is part of a broader effort to build reusable, well-documented tools for data-driven projects.
---
## π¬ Contact
Feel free to reach out with questions or collaboration ideas:
π§ github.stunt845@passinbox.com
π GitHub: [@rlapine](https://github.com/rlapine)
Raw data
{
"_id": null,
"home_page": "https://github.com/rlapine/DetailLogger",
"name": "DetailLogger",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": null,
"author": "Ryan LaPine",
"author_email": "github.stunt845@passinbox.com",
"download_url": "https://files.pythonhosted.org/packages/7a/6b/aea07dae7a66d4c55ffcd188a2e08a7f181bdf92314209b2227df08606eb/detaillogger-0.1.4.tar.gz",
"platform": null,
"description": "<p align=\"center\">\r\n <img src=\"https://raw.githubusercontent.com/rlapine/detaillogger/refs/heads/main/assets/detaillogger_logo_2.png\" alt=\"DetailLogger logo\" width=\"400\"/>\r\n</p>\r\n\r\n---\r\n\r\n## \ud83c\udfa8 DetailLogger V 0.1.4\r\n\r\n---\r\n\r\n[](https://www.python.org/downloads/)\r\n[](LICENSE)\r\n[](https://github.com/rlapine/detaillogger/stargazers)\r\n[](https://github.com/rlapine/detaillogger/network/members)\r\n\r\n---\r\n\r\n## \u2728 Overview\r\n\r\nDetailLogger is a lightweight Python utility for enhanced logging and exception tracing. It automatically captures contextual information\u2014such as file name, function, and line number\u2014whenever messages or exceptions are logged. Ideal for debugging, monitoring, and building maintainable systems.\r\n\r\n---\r\n\r\n## \ud83d\udce6 Installation\r\n\r\n`pip install detaillogger`\r\n\r\n---\r\n\r\n## \u2699\ufe0f Features\r\n\r\n- \u2705 Logs messages with caller context \r\n- \u2705 Captures exceptions with full traceback \r\n- \u2705 Supports console and file-based logging \r\n- \u2705 Uses wrapper functions for quick integration \r\n- \u2705 Built entirely on standard libraries\r\n\r\n---\r\n\r\n## \u270d\ufe0f API Overview\r\n\r\n- `DetailLogger(level, fmt, file_name)`: Create an instance with optional file output and log level \r\n- `log(message: str)`: Logs message with caller metadata \r\n- `log_exception(ex: BaseException, details: Optional[str])`: Logs exception type, message, optional details, and source context\r\n\r\n---\r\n\r\n## \ud83e\uddea Usage\r\n\r\n# Run the built-in CLI demo for testing:\r\n\r\n`python detaillogger.py`\r\n\r\n# Embedded Example\r\n\r\n```\r\nfrom detaillogger import log, log_exception\r\n\r\nlog(\"This is a message to log.\")\r\n\r\ntry:\r\n x = 1 / 0\r\nexcept Exception as e:\r\n log_exception(e, details=\"This is a message about the exception to log.\")\r\n```\r\n\r\n**Console Output:**\r\n\r\n```\r\n2025-07-28 17:02:27,674 - DEBUG - Details: This is a message to log.\r\n2025-07-28 17:02:27,674 - DEBUG - From: c:\\Users\\ryan\\...detaillogger.py\r\n2025-07-28 17:02:27,675 - DEBUG - Function: main()\r\n2025-07-28 17:02:27,675 - DEBUG - Line: 3\r\n\r\n2025-07-28 17:05:22,185 - DEBUG - Exception type: ZeroDivisionError\r\n2025-07-28 17:05:22,186 - DEBUG - Exception message: division by zero\r\n2025-07-28 17:05:22,186 - DEBUG - Details: This is a message about the exception to log.\r\n2025-07-28 17:05:22,186 - DEBUG - File: ...detaillogger.py\r\n2025-07-28 17:05:22,186 - DEBUG - Function: main()\r\n2025-07-28 17:05:22,186 - DEBUG - Line: 6\r\n```\r\n\r\n# Embedded Example\r\n\r\n```\r\n# To log to a file and console, instantiate DetailLogger class with filename.\r\nfrom detaillogger import log, log_exception\r\n\r\nlogger = DetailLogger(file_name=\"detail.log\")\r\n\r\nlog(\"This is a message to log to file.\")\r\n\r\ntry:\r\n x = 1 / 0\r\nexcept Exception as e:\r\n log_exception(e, details=\"This is a message about the exception to log to file.\")\r\n```\r\n\r\n**File Output:**\r\n\r\n\r\n\r\n---\r\n\r\n## \ud83d\udd27 Built-in demo:\r\n\r\n`python detaillogger.py`\r\n\r\n```\r\nAlso log to file? (y/n):y\r\nEnter filname:detail.log\r\n\r\nOptions\r\n1) Log details.\r\n2) Log 'division by zero' exception.\r\n3) Log custom exception.\r\nq) Exit.\r\nEnter an option:1\r\n\r\nEnter message to log:This is a message.\r\n2025-07-30 14:46:04,161 - DEBUG - Details: This is a message.\r\n2025-07-30 14:46:04,161 - DEBUG - From: c:\\Users\\ryan\\Visual Code Projects\\git_repositories\\detaillogger\\detaillogger.py\r\n2025-07-30 14:46:04,162 - DEBUG - Function: main()\r\n2025-07-30 14:46:04,162 - DEBUG - Line: 179\r\n\r\nMessage logged.\r\n```\r\n\r\n---\r\n\r\n## \ud83e\uddf1 File Structure\r\n\r\n```\r\ndetaillogger/\r\n\u251c\u2500\u2500 detaillogger.py # Core module\r\n\u251c\u2500\u2500 test_detaillogger.py # Unit test suite\r\n\u251c\u2500\u2500 assets/ # Folder for images, badges, or other static assets\r\n\u2502 \u251c\u2500\u2500 detaillogger_logo_2.png # Logo for documentation\r\n\u2502 \u2514\u2500\u2500 image.png # File output \r\n\u251c\u2500\u2500 README.md # Documentation\r\n\u251c\u2500\u2500 detaillogger.log # Optional output log file\r\n```\r\n\r\n---\r\n\r\n## \ud83e\udd1d Contributing\r\n\r\nPull requests are welcome! For major changes, open an issue to discuss improvements first.\r\n\r\n---\r\n\r\n## \ud83d\udcc4 License\r\n\r\nThis project is licensed under the [MIT License](LICENSE).\r\n\r\n---\r\n\r\n## \ud83d\udc64 Author\r\n\r\nCreated by Ryan LaPine [@rlapine](https://github.com/rlapine) \u2014 a technically skilled developer focused on clarity, maintainability, and audience-ready documentation. This class is part of a broader effort to build reusable, well-documented tools for data-driven projects.\r\n\r\n---\r\n\r\n## \ud83d\udcec Contact\r\n\r\nFeel free to reach out with questions or collaboration ideas:\r\n\r\n\ud83d\udce7 github.stunt845@passinbox.com \r\n\ud83d\udd17 GitHub: [@rlapine](https://github.com/rlapine)\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Styled console printing made simple \u2014 color, format, and clarity in one package.",
"version": "0.1.4",
"project_urls": {
"Homepage": "https://github.com/rlapine/DetailLogger"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "f839328513798545bb2038b85fc380f512ed6b7f5c0bca8fe603b6e25f041daa",
"md5": "fc49141419dcd86a235f8dc6daecbe9d",
"sha256": "c714e52913f7cbd122417778b1d724ab0809da48b99293bdcd098261d3017de4"
},
"downloads": -1,
"filename": "detaillogger-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fc49141419dcd86a235f8dc6daecbe9d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 4267,
"upload_time": "2025-07-30T22:16:13",
"upload_time_iso_8601": "2025-07-30T22:16:13.950759Z",
"url": "https://files.pythonhosted.org/packages/f8/39/328513798545bb2038b85fc380f512ed6b7f5c0bca8fe603b6e25f041daa/detaillogger-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "7a6baea07dae7a66d4c55ffcd188a2e08a7f181bdf92314209b2227df08606eb",
"md5": "19b61954f793a98467186d6179271a10",
"sha256": "ed45065834b50f15d421b1251781e8fa4c1ae95db99163d317a80d8dc497812a"
},
"downloads": -1,
"filename": "detaillogger-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "19b61954f793a98467186d6179271a10",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 4053,
"upload_time": "2025-07-30T22:16:15",
"upload_time_iso_8601": "2025-07-30T22:16:15.066301Z",
"url": "https://files.pythonhosted.org/packages/7a/6b/aea07dae7a66d4c55ffcd188a2e08a7f181bdf92314209b2227df08606eb/detaillogger-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-30 22:16:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rlapine",
"github_project": "DetailLogger",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "detaillogger"
}