Dead simple Python logger. Redirects stdout to a file while maintaining console printing.
Project description
logger_util
Dead simple Python logger.
This library redirects the stdout and stderr to a Log object that saves the text printed to the console to a file. The file is auto-generated and is named based on the number of files in the log directory. Adding simple LogLevel attributes at the start of your printed debug text allows the log to be parsed and separately into severity levels.
Install using: pip install logger-util==0.2
from logger_util import CreateLogger, log_startup
if __name__ == "__main__":
CreateLogger()
log_startup()
print("INFO: This is a test message.")
Calling CreateLogger will instantiate all the necessary variables, files, and directories. Nothing more needs to be done other than writing to the console.
This library is licensed under the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file logger_util-0.3.0.tar.gz
.
File metadata
- Download URL: logger_util-0.3.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf6a8a08421b72316c03e0af5795dfe365ff8b25d58940176c1bbbbc786e4225 |
|
MD5 | 7edfbc8afa15f382f7e656e8082c2225 |
|
BLAKE2b-256 | 2a8369fc229948a47c92be9449a193d341ed869cb6f092df29e3c2712283b8a2 |
File details
Details for the file logger_util-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: logger_util-0.3.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f61b5a944463583b7f4cf9845220e216aa09cb46c519531418cf0a71b229e6a |
|
MD5 | 01d8ba05600283f8c028b93e85b05853 |
|
BLAKE2b-256 | f15242b590d6f0a342d4e2090a0243f7c6cc64a65d4ecaa48e4ea28ddda003fe |