An easy use and more powerful android style logging util
Project description
tinylogger
An easy use and more powerful android style logging util
Installation
To install tinylogger run this command:
pip install tinylogger
or download Package then run this command:
pip install tinylogger-1.0.0-py3-none-any.whl
Usage
Basic Usage
The typical usage of this library is like the following:
from tinylogger.log import Log
if __name__ == "__main__":
Log.d("test")
output to stdout and log file in current work dir
2019-08-25 07:49:48.780000 - INFO - log.py (_get_instance:69): log path: D:\
develop\test\log_20190825_074948.txt
2019-08-25 07:49:48.782000 - DEBUG - test.py (__main__ :8): test
Full Usage
Or like this:
import os
import logging
from tinylogger.log import Log
if __name__ == "__main__":
Log.setup(os.path.join(os.getcwd(), "log"), logging.DEBUG)
Log.d("test")
output to stdout and log file in current work dir
2019-08-25 07:52:32.514000 - INFO - log.py (setup :78): log path: D:\dev
elop\test\log\log_20190825_075232.txt
2019-08-25 07:52:32.515000 - DEBUG - test.py (__main__ :8): test
Quiet print
If you don't want to print log in stdout, then setup as below:
Log.setup(os.path.join(os.getcwd(), "log", True),
Custom Configs
setup(cls, log_dir=os.path.join(os.getcwd()), log_level=logging.DEBUG, quiet=False)
log_dir: the dir to write log file
log_level: control log msg to log file expect stdout
quiet: do not print log in stdout
Distribute
cd path/to/tinylogger-dist/
python -m venv venv
venv\Scripts\activate.bat
pip install -r requirements.txt
python setup.py bdist_wheel
twine upload dist/*
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.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size tinylogger-1.0.0-py3-none-any.whl (4.0 kB) | File type Wheel | Python version py3 | Upload date | Hashes View |
Close
Hashes for tinylogger-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e109450f2198ae465b95a461a3a64c2360d9f80af100cc0210a86157f6d71b61 |
|
MD5 | 9abb60e70fcf52eb0f45e0e551edbc54 |
|
BLAKE2-256 | 5e73d4839308f1229faef2427c9ebc4ec0acc19085e1e595f1789dffe4deee04 |