No project description provided
Project description
TruLogger
A simple python log library
Installation
Install via pip
pip install TruLogger
Usage
Here are some simple examples of usage:
import trulogger
logger = trulogger.TruLogger({'verbose': True})
# define a custom prefix
logger.set_prefix("custom prefix")
logger.info("This is info")
# [ 2022-10-22 16:37:02 ] [ INFO ] custom prefix This is info
logger.error("This is error")
# [ 2022-10-22 16:37:02 ] [ ERROR ] custom prefix This is error
logger.warning("This is warning")
# [ 2022-10-22 16:37:02 ] [ WARNING ] custom prefix This is warning
logger.debug("This is debug")
# [ 2022-10-22 16:37:02 ] [ DEBUG ] custom prefix This is debug
logger.success("This is success")
# [ 2022-10-22 16:37:02 ] [ SUCCESS ] custom prefix This is success
logger.add_to_log("This is a simple add")
# This is a simple add
# Create a new logger with traceback included
logger2 = trulogger.TruLogger({'verbose': True, 'traceback': True})
logger2.set_prefix("custom prefix")
logger2.info("This is info")
# [ 2022-10-22 16:37:02 ] [ INFO ] custom prefix This is info
# clear the custom prefix
logger2.reset_prefix()
logger2.error("This is error")
# [ 2022-10-22 16:37:02 ] [ ERROR ] This is error
# [<FrameSummary file /Users/jacobtruman/workspace/personal/TruLogger/tests.py, line 22 in <module>>, <FrameSummary file /Users/jacobtruman/workspace/personal/TruLogger/trulogger/__init__.py, line 93 in error>]
logger2.warning("This is warning")
# [ 2022-10-22 16:37:02 ] [ WARNING ] This is warning
logger2.debug("This is debug")
# [ 2022-10-22 16:37:02 ] [ DEBUG ] This is debug
logger2.success("This is success")
# [ 2022-10-22 16:37:02 ] [ SUCCESS ] This is success
logger2.add_to_log("This is a simple add")
# This is a simple add
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
TruLogger-1.1.8.tar.gz
(1.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file TruLogger-1.1.8.tar.gz.
File metadata
- Download URL: TruLogger-1.1.8.tar.gz
- Upload date:
- Size: 1.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ae2d10158939674011f73f293323b2a9462823996661a3a3d222139a178950d
|
|
| MD5 |
47f2455daa8ff7a8f761b5886e8e5409
|
|
| BLAKE2b-256 |
9f62388204ed71d9365cf1232e03b5654b0dd775a9243d5ac49a854bce93b31a
|
File details
Details for the file TruLogger-1.1.8-py3-none-any.whl.
File metadata
- Download URL: TruLogger-1.1.8-py3-none-any.whl
- Upload date:
- Size: 1.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86fab2aed36feb8f9903a77eb08f7f9a58e6a967d4b4d29c6adaf0cf11e0fc05
|
|
| MD5 |
32d922d7e73d9e214ee6523b1fcf759b
|
|
| BLAKE2b-256 |
e59f502a6e7132b43933ba093196ea2e83e130c571a0d7d1db51ac8b4501753b
|