# Overview
The purpose of this library is to provide a logger for my other projects. It also
is acting as a learning process for publishing a python module.
# Messages Package
This is a package that can be included in projects to output messages
Example logging REPO: https://github.com/srtamrakar/python-logger/tree/master
# Repository structure
```bash
run 'tree' at the top of the repo:
.
├── CHANGELOG.md
├── LICENSE
├── README.md
├── pyproject.toml
├── requirements.txt
├── setup.py
├── src
│ ├── demo.py
│ └── phootlogger
│ ├── __init__.py
│ └── logger.py
└── tests
└── phootlogger
└── test_logger.py
```
## Installation Process:
```bash
#=======================
# 1. Write the module
#=======================
# Follow this tutorial: https://packaging.python.org/en/latest/tutorials/packaging-projects/
# Required files:
# setup.py
# LICENSE
# README
#=======================
# 2. Build module
#=======================
$ python3 -m pip install --upgrade build
$ python3 -m build
#=======================
# 3. Upload module to pypi to be installed
#=======================
# Make sure twin is installed
$ python3 -m pip install --upgrade twine
# Upload to test server ( https://test.pypi.org/project/phootlogger/ ):
$ python3 -m twine upload --repository phootlogger-test dist/* --verbose
# Upload to real server ( https://pypi.org/project/phootlogger/ ):
$ python3 -m twine upload --repository phootlogger dist/* --verbose
#=======================
# 4. Install the module:
#=======================
# Test Installation
$ python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps phootlogger
# Real installation
$ python3 -m pip install phootlogger
```
## Testing
### Unit Tests
```bash
# From the top level directory, run the command
$ pytest --cov=src/. tests/
```
### Running the demo
```bash
# A demo file can be found in src/demo.py
# To run it and see examples of the feature, run the following
$ python demo.py
# ==========================================
# Output:
# ==========================================
# ==========================================
# Start of Nominal Demo
# ==========================================
#
# 2025-08-22 18:48:11.150962 : Test.nominal_demo : [ERROR] : Error message here.
# 2025-08-22 18:48:11.151044 : Test.nominal_demo : [WARNING] : Warning message here.
# 2025-08-22 18:48:11.151064 : Test.nominal_demo : [INFO] : Info message here.
# 2025-08-22 18:48:11.151085 : Test.nominal_demo : [DEBUG] : Debug message here.
#
# ==========================================
# Start of Showing/Hiding Fields Demo
# ==========================================
#
#
# ------------------------------------------
# No fields hidden.
# ------------------------------------------
# 2025-08-22 18:48:11.151110 : Test.hiding_fields_demo : [ERROR] : Error message here.
# 2025-08-22 18:48:11.151117 : Test.hiding_fields_demo : [WARNING] : Warning message here.
# 2025-08-22 18:48:11.151122 : Test.hiding_fields_demo : [INFO] : Info message here.
# 2025-08-22 18:48:11.151129 : Test.hiding_fields_demo : [DEBUG] : Debug message here.
#
# ------------------------------------------
# Timestamps hidden.
# ------------------------------------------
# Test.hiding_fields_demo : [ERROR] : Error message here.
# Test.hiding_fields_demo : [WARNING] : Warning message here.
# Test.hiding_fields_demo : [INFO] : Info message here.
# Test.hiding_fields_demo : [DEBUG] : Debug message here.
#
# ------------------------------------------
# Source ( class/method name ) Hidden.
# ------------------------------------------
# 2025-08-22 18:48:11.151215 : [ERROR] : Error message here.
# 2025-08-22 18:48:11.151219 : [WARNING] : Warning message here.
# 2025-08-22 18:48:11.151223 : [INFO] : Info message here.
# 2025-08-22 18:48:11.151227 : [DEBUG] : Debug message here.
#
# ------------------------------------------
# Source and Timestamps Hidden.
# ------------------------------------------
# [ERROR] : Error message here.
# [WARNING] : Warning message here.
# [INFO] : Info message here.
# [DEBUG] : Debug message here.
#
# ------------------------------------------
# Owner Shown.
# ------------------------------------------
# 2025-08-22 18:48:11.151252 : /example/path/to/phootlogger/src/demo.py : Test.hiding_fields_demo : [ERROR] : Error $ message here.
# 2025-08-22 18:48:11.151257 : /example/path/to/phootlogger/src/demo.py : Test.hiding_fields_demo : [WARNING] : Warning $ message here.
# 2025-08-22 18:48:11.151260 : /example/path/to/phootlogger/src/demo.py : Test.hiding_fields_demo : [INFO] : Info $ $ message here.
# 2025-08-22 18:48:11.151264 : /example/path/to/phootlogger/src/demo.py : Test.hiding_fields_demo : [DEBUG] : Debug $ message here.
#
# ==========================================
# Start of Deprecation Demo
# ==========================================
#
# *****************************************************************
# * WARNING:
# * This class has been DEPRECATED. It's name has been changed to "Logger".
# * This specific instance will soon no longer work.
# *****************************************************************
# 2025-08-22 18:48:11.156938 : Test.deprecation_demo : [ERROR] : error message here.
# WARNING. The method 'system' will soon DEPRECATED.
# 2025-08-22 18:48:11.160526 : Test.deprecation_demo : [INFO] : normal message here.
#
# ==========================================
# Start of Quit Script Demo
# ==========================================
```
# Questions:
setup.cfg:
setup.py:
Instructions to build software. Maybe some configuration options like computing test coverage or unit tests or
the install prefix.
pyproject.toml:
Specifies the project's metadata.
Used to replace .cfg, but formats everything in TOML. ( Tom's Obvious, Minimal Language: https://en.wikipedia.org/wiki/TOML )
You can put "Abstract Dependencies" here, but not pinned dependencies. Pinned ones belong in the requirements.txt
requirements.txt:
Not the same thing as setup.cfg. Needed for a different reason. This is typically used for deployment with
version pinned dependencies. The reason is so you don't get the latest and greatest, and only get the version
you know you have explicitly tested.
Raw data
{
"_id": null,
"home_page": null,
"name": "phootlogger",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "messages, logger",
"author": null,
"author_email": "Parker Hooten <parkerhooten@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/1b/97/745367ba56d36da36dc46003d930627772bd4c9d8a697f48b392310ef907/phootlogger-0.1.0.tar.gz",
"platform": null,
"description": "# Overview\nThe purpose of this library is to provide a logger for my other projects. It also\nis acting as a learning process for publishing a python module.\n\n# Messages Package\nThis is a package that can be included in projects to output messages\n\nExample logging REPO: https://github.com/srtamrakar/python-logger/tree/master\n\n# Repository structure\n```bash\nrun 'tree' at the top of the repo:\n.\n\u251c\u2500\u2500 CHANGELOG.md\n\u251c\u2500\u2500 LICENSE\n\u251c\u2500\u2500 README.md\n\u251c\u2500\u2500 pyproject.toml\n\u251c\u2500\u2500 requirements.txt\n\u251c\u2500\u2500 setup.py\n\u251c\u2500\u2500 src\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 demo.py\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 phootlogger\n\u2502\u00a0\u00a0 \u00a0\u00a0 \u251c\u2500\u2500 __init__.py\n\u2502\u00a0\u00a0 \u00a0\u00a0 \u2514\u2500\u2500 logger.py\n\u2514\u2500\u2500 tests\n \u2514\u2500\u2500 phootlogger\n \u2514\u2500\u2500 test_logger.py\n```\n\n## Installation Process:\n```bash\n#=======================\n# 1. Write the module\n#=======================\n# Follow this tutorial: https://packaging.python.org/en/latest/tutorials/packaging-projects/\n\n# Required files:\n# setup.py\n# LICENSE\n# README\n\n#=======================\n# 2. Build module\n#=======================\n$ python3 -m pip install --upgrade build\n$ python3 -m build\n\n#=======================\n# 3. Upload module to pypi to be installed\n#=======================\n# Make sure twin is installed\n$ python3 -m pip install --upgrade twine\n\n# Upload to test server ( https://test.pypi.org/project/phootlogger/ ):\n$ python3 -m twine upload --repository phootlogger-test dist/* --verbose\n\n# Upload to real server ( https://pypi.org/project/phootlogger/ ):\n$ python3 -m twine upload --repository phootlogger dist/* --verbose\n\n#=======================\n# 4. Install the module:\n#=======================\n# Test Installation\n$ python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps phootlogger\n\n# Real installation\n$ python3 -m pip install phootlogger\n```\n\n## Testing\n### Unit Tests\n```bash\n# From the top level directory, run the command\n$ pytest --cov=src/. tests/\n```\n\n### Running the demo\n```bash\n# A demo file can be found in src/demo.py\n\n# To run it and see examples of the feature, run the following\n$ python demo.py\n\n# ==========================================\n# Output:\n# ==========================================\n# ==========================================\n# Start of Nominal Demo\n# ==========================================\n#\n# 2025-08-22 18:48:11.150962 : Test.nominal_demo : [ERROR] : Error message here.\n# 2025-08-22 18:48:11.151044 : Test.nominal_demo : [WARNING] : Warning message here.\n# 2025-08-22 18:48:11.151064 : Test.nominal_demo : [INFO] : Info message here.\n# 2025-08-22 18:48:11.151085 : Test.nominal_demo : [DEBUG] : Debug message here.\n#\n# ==========================================\n# Start of Showing/Hiding Fields Demo\n# ==========================================\n#\n#\n# ------------------------------------------\n# No fields hidden.\n# ------------------------------------------\n# 2025-08-22 18:48:11.151110 : Test.hiding_fields_demo : [ERROR] : Error message here.\n# 2025-08-22 18:48:11.151117 : Test.hiding_fields_demo : [WARNING] : Warning message here.\n# 2025-08-22 18:48:11.151122 : Test.hiding_fields_demo : [INFO] : Info message here.\n# 2025-08-22 18:48:11.151129 : Test.hiding_fields_demo : [DEBUG] : Debug message here.\n#\n# ------------------------------------------\n# Timestamps hidden.\n# ------------------------------------------\n# Test.hiding_fields_demo : [ERROR] : Error message here.\n# Test.hiding_fields_demo : [WARNING] : Warning message here.\n# Test.hiding_fields_demo : [INFO] : Info message here.\n# Test.hiding_fields_demo : [DEBUG] : Debug message here.\n#\n# ------------------------------------------\n# Source ( class/method name ) Hidden.\n# ------------------------------------------\n# 2025-08-22 18:48:11.151215 : [ERROR] : Error message here.\n# 2025-08-22 18:48:11.151219 : [WARNING] : Warning message here.\n# 2025-08-22 18:48:11.151223 : [INFO] : Info message here.\n# 2025-08-22 18:48:11.151227 : [DEBUG] : Debug message here.\n#\n# ------------------------------------------\n# Source and Timestamps Hidden.\n# ------------------------------------------\n# [ERROR] : Error message here.\n# [WARNING] : Warning message here.\n# [INFO] : Info message here.\n# [DEBUG] : Debug message here.\n#\n# ------------------------------------------\n# Owner Shown.\n# ------------------------------------------\n# 2025-08-22 18:48:11.151252 : /example/path/to/phootlogger/src/demo.py : Test.hiding_fields_demo : [ERROR] : Error $ message here.\n# 2025-08-22 18:48:11.151257 : /example/path/to/phootlogger/src/demo.py : Test.hiding_fields_demo : [WARNING] : Warning $ message here.\n# 2025-08-22 18:48:11.151260 : /example/path/to/phootlogger/src/demo.py : Test.hiding_fields_demo : [INFO] : Info $ $ message here.\n# 2025-08-22 18:48:11.151264 : /example/path/to/phootlogger/src/demo.py : Test.hiding_fields_demo : [DEBUG] : Debug $ message here.\n#\n# ==========================================\n# Start of Deprecation Demo\n# ==========================================\n#\n# *****************************************************************\n# * WARNING:\n# * This class has been DEPRECATED. It's name has been changed to \"Logger\".\n# * This specific instance will soon no longer work.\n# *****************************************************************\n# 2025-08-22 18:48:11.156938 : Test.deprecation_demo : [ERROR] : error message here.\n# WARNING. The method 'system' will soon DEPRECATED.\n# 2025-08-22 18:48:11.160526 : Test.deprecation_demo : [INFO] : normal message here.\n#\n# ==========================================\n# Start of Quit Script Demo\n# ==========================================\n```\n\n# Questions:\n setup.cfg:\n\n setup.py:\n Instructions to build software. Maybe some configuration options like computing test coverage or unit tests or\n the install prefix.\n\n pyproject.toml:\n Specifies the project's metadata.\n Used to replace .cfg, but formats everything in TOML. ( Tom's Obvious, Minimal Language: https://en.wikipedia.org/wiki/TOML )\n You can put \"Abstract Dependencies\" here, but not pinned dependencies. Pinned ones belong in the requirements.txt\n\n requirements.txt:\n Not the same thing as setup.cfg. Needed for a different reason. This is typically used for deployment with\n version pinned dependencies. The reason is so you don't get the latest and greatest, and only get the version\n you know you have explicitly tested.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Package to print out messages to user.",
"version": "0.1.0",
"project_urls": {
"Bug Tracker": "https://github.com/phooten/phootlogger/issues",
"Homepage": "https://github.com/phooten/phootlogger/"
},
"split_keywords": [
"messages",
" logger"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "6a307a4ffd0f9a2b651bcc201c6f19f1b1740d96eb9b7ff23defd6ab6a3ffb3d",
"md5": "0e091756105067b251199a2378ce444a",
"sha256": "21c15655b5e07909d98bebc9e8971bc93bfac02729ca1c0a533ece3c4254ea43"
},
"downloads": -1,
"filename": "phootlogger-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0e091756105067b251199a2378ce444a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 8106,
"upload_time": "2025-08-23T03:06:36",
"upload_time_iso_8601": "2025-08-23T03:06:36.532737Z",
"url": "https://files.pythonhosted.org/packages/6a/30/7a4ffd0f9a2b651bcc201c6f19f1b1740d96eb9b7ff23defd6ab6a3ffb3d/phootlogger-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "1b97745367ba56d36da36dc46003d930627772bd4c9d8a697f48b392310ef907",
"md5": "18ea682767e856991bef8747edfa084e",
"sha256": "bf430ca8e09b7e6c7dbf18b6deb91b1d54776eb1c7428f698d00bbd3f0cc7771"
},
"downloads": -1,
"filename": "phootlogger-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "18ea682767e856991bef8747edfa084e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 9406,
"upload_time": "2025-08-23T03:06:37",
"upload_time_iso_8601": "2025-08-23T03:06:37.619922Z",
"url": "https://files.pythonhosted.org/packages/1b/97/745367ba56d36da36dc46003d930627772bd4c9d8a697f48b392310ef907/phootlogger-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-23 03:06:37",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "phooten",
"github_project": "phootlogger",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "pip",
"specs": [
[
"==",
"23.3.1"
]
]
},
{
"name": "pandas",
"specs": [
[
"==",
"2.1.3"
]
]
},
{
"name": "phootlogger",
"specs": [
[
"==",
"0.1.0"
]
]
},
{
"name": "pytest",
"specs": [
[
"==",
"8.4.1"
]
]
},
{
"name": "pytest-cov",
"specs": [
[
"==",
"6.2.1"
]
]
}
],
"lcname": "phootlogger"
}