adding setup.py

This commit is contained in:
Dominik Kuhn 2022-11-11 10:19:19 +01:00
parent ffbc76ff39
commit 3983128337
7 changed files with 122 additions and 25 deletions

91
.gitignore vendored Normal file
View File

@ -0,0 +1,91 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# IPython Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# dotenv
.env
# virtualenv
venv/
ENV/
config
# modules
# Spyder project settings
.spyderproject
# Rope project settings
.ropeproject

View File

@ -1,25 +0,0 @@
import socket
from helpers import customLogger, customMQTTLogger
def test_logging():
logger = customLogger('customLogger','MyApp.log')
mqtt_logger = customMQTTLogger('customMQTTLogger', level='DEBUG', TOPIC='testLogging', BROKER='192.168.6.17')
logger.debug("debug message")
mqtt_logger.logger.debug("debug message")
logger.info("info message")
logger.warning("warning message")
logger.error("error message")
logger.critical("critical message")
logger.info("Hello World")
logger.info("Request from {} handled in {:.3f} ms", socket.gethostname(), 11)
logger.info("Request from {} handled in {:.3f} ms", "127.0.0.1", 33.1)
if __name__ == "__main__":
test_logging()

31
setup.py Normal file
View File

@ -0,0 +1,31 @@
from distutils.core import setup
import setuptools
try:
long_description = open("README").read()
except:
long_description = """Custom Logger with coloring etc. in Python"""
if __name__ == "__main__":
setup(name="PythonCustomLogger",
version='1.0',
description="PythonCustomLogger-add text here...",
long_description=long_description,
long_description_content_type="text/markdown",
author="Dominik Kuhn",
author_email="d.kuhn@zema.de",
maintainer="Dominik Kuhn",
maintainer_email="d.kuhn@zema.de",
install_requires=['paho-mqtt','bunyan'],
url="https://git.zema.de/tfs/ZISS/_git/PythonCustomLogger",
packages=["customLogger"],
classifiers=[
# "Development Status :: 4 - Production/Stable",
# "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Scientific/Engineering",
"Topic :: Software Development :: Libraries :: Python Modules",
],
)