Python logs to HTML formatter
Project description
py2hlog (Python to HTML log)
https://github.com/houshmand-2005/py2hlog
Python logs to HTML formatter
simple useage :
from py2hlog import logger
import time
obj1 = logger.py2hlog() # create an object from py2hlog
obj1.file_name = "new_log_file.txt" # here write the log detail
try:
if a == 2:
print("Iam working!")
except:
obj1.error("I dont have any 'a' variable")
print("print obj1: ", obj1)
time.sleep(5) # to see time changing
obj1.debug("Add a variable before the 'if' like a = 3")
obj1.makehtml("py2hlog.html") # enter the name of output file
# you can also use these statuses :
# _____________________________
# obj1.critical("your message")
# obj1.debug("your message")
# obj1.info("your message")
# obj1.warning("your message")
# obj1.error("your message")
# _____________________________
Also you can mark a part of your code for each status like this:
from py2hlog import logger
object_of_py2hlog = logger.py2hlog()
object_of_py2hlog.file_name = "Py2hlog.txt"
object_of_py2hlog.warning("you can also mark a part of code for this status like -->", 1, 5)
# ("msg", start line, end line)
object_of_py2hlog.makehtml("Py2hlog.html")
https://houshmand-2005.github.io/ houshmand2005
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
py2hlog-0.1.3.tar.gz
(7.4 kB
view details)
Built Distribution
File details
Details for the file py2hlog-0.1.3.tar.gz
.
File metadata
- Download URL: py2hlog-0.1.3.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db1e9f14c6d93a04c56cd3cbc6e7a6136db881a591daa3120d803cb2163cd99f |
|
MD5 | d973457f220a6135d65c50492024efa0 |
|
BLAKE2b-256 | 1a219047d192105e18b44baa430a5c9aed24a872af2eb616d069dcf75a77578f |
File details
Details for the file py2hlog-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: py2hlog-0.1.3-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e7890e49dedba6a30b546ffe884acf6d3e35d8467f3a24b84716be1fd40b024 |
|
MD5 | c750c39d27e192992c85459cb9fd7a99 |
|
BLAKE2b-256 | a8b74cc20061e397f2d62fb89260bd5b90c56d46b87c784f8323f084989735d3 |