A lightweight logging package
Table of contents
- Creating a log
- Logging plaintext
- Logging debug information
- Logging information
- Logging warnings
- Logging errors
Installation
Using pip
To install this package using pip, simply run the following command:
Unix/mac/linux
pip3 install woodchopper
Windows
pip install woodchopper
Building from source
Unix/mac/linux
Requirements
- Python >=3.8.1
- Git
- Poetry >=1.5.1
Run the following in the terminal:
git clone https://github.com/TinkerTown-SEMI/woodchopper.git
cd woodchopper
make install-dev
make -j4 all
make build
Windows
Requirements
- Python >=3.8.1
- Git
- Poetry >=1.5.1
- w64devkit (GNU binaries for windows, including
make). When you extract the folder, add the folder to the path.
Run the following in the terminal:
git clone https://github.com/TinkerTown-SEMI/woodchopper.git
cd woodchopper
make install-dev
make -j4 all
make build
Usage
Creating a log
To use woodchopper, you first have to create a log.
from woodchopper import Logging_Levels, DateTime_Defaults, Styles, Logger
from pathlib import Path
log = Logger(
Path("./spam.log").resolve(), # Path to log file
show_datetime=DateTime_Defaults.DO_NOT_SHOW, # Don't show date and time. Other options: DateTime_Defaults.DATE_AND_TIME, DateTime_Defaults.DATE_ONLY, DateTime_Defaults.TIME_ONLY
logging_level=Logging_Levels.DEBUG, # Allow all logging operations. Other options: Logging_Levels.DEFAULT, Logging_Levels.WARNING, Logging_Levels.ERROR, Logging_Levels.SILENT.
quiet=True # Suppress log messages on creation and deletion.
)
Logging plaintext
log.log("Hello, world!")
Output
Hello, world!
Logging debug information
log.debug("Ate 1 can of spam. Cans of spam remaining: 25.")
Output1
DEBUG: Ate 1 can of spam. Cans of spam remaining: 25.
Logging information
log.info("Sent order for 50 cans of spam.")
Output1
INFO: Sent order for 50 cans of spam.
Logging warnings
log.warn("Running low on spam: 7 cans left.")
Output1
WARNING: Running low on spam: 7 cans left.
Logging errors
log.error("Houston, we have a problem: cans of spam left: 0.")
Output1
ERROR: Houston, we have a problem: cans of spam left: 0.
Getting help
You can get help regarding this package in many ways. If you need help with syntax, your first stop should always be help manuals, so you could use python's built-in help function, as we do not yet have full documentation published(sorry). For errors, it should be the bug tracker, and for more generic python errors, you could go over to StackOverflow.
Happy logging, folks
Metadata
Release files for woodchopper 2.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| woodchopper-2.0.5.tar.gz | 7.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| woodchopper-2.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.6 kB
Release files / woodchopper-2.0.5.tar.gz
| Download URL | woodchopper-2.0.5.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b3d8c3ec6633a7e2441dff01755374aed52674b670149bc39dd5236b3a871c1e
|
|
BLAKE2b-256 checksum How to use checksums |
ff45c4e79cfff8582d63ec1334c29d47b1f10e857c1ba20b428e3e2c1434532d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.5
|
Release files / woodchopper-2.0.5-py3-none-any.whl
| Download URL | woodchopper-2.0.5-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c8484833961b7611c735c63140f0542d575e0e95af487cceedb1434c4d4f5408
|
|
BLAKE2b-256 checksum How to use checksums |
2ac2b230debd0a9faf44ba2d46395f33862d2f14abac4a4ac4853d7eb68ff06d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.5
|