Skip to main content

A lightweight logging package

Project description

Woodchopper

A lightweight logging package

<style> span.debug, span.info, span.warn, span.error { font-weight: bold; } span.debug { color: orange; } span.info { color: blue; } span.warn { color: yellow; } span.error { color: red; } </style>

Table of contents

Back to Top

Table of contents

Installation

Usage

Getting help

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 lint test
make -j4 all

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 lint test
make -j4 all

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.")
Output:
DEBUG: Ate 1 can of spam. Cans of spam remaining: 25.

Logging information

log.info("Sent order for 50 cans of spam.")
Output:
INFO: Sent order for 50 cans of spam.

Logging warnings

log.warn("Running low on spam: 7 cans left.")
Output:
WARNING: Running low on spam: 7 cans left.

Logging errors

log.error("Houston, we have a problem: cans of spam left: 0.")
Output:
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!

Log

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

woodchopper-2.0.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

woodchopper-2.0.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file woodchopper-2.0.0.tar.gz.

File metadata

  • Download URL: woodchopper-2.0.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for woodchopper-2.0.0.tar.gz
Algorithm Hash digest
SHA256 3a2638f03ae7aa1226cf21ffaf9cd84d76e6743d157724c1794b0f6706e66843
MD5 a4bd54d4e779869957764321163d34c3
BLAKE2b-256 e469377d33b79dd4cfe8461d4bd2d1d8f0f5cf914e4ac615180a2cd045b91edf

See more details on using hashes here.

File details

Details for the file woodchopper-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: woodchopper-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for woodchopper-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 95e24361060a8370fbd9b22d689ae3c2f46e3cfe18f8afdaa248dcbfbdc7a550
MD5 d1154657fdf3c1f9fc6bc4f3efda029c
BLAKE2b-256 bff38c95f57e187fb945f806b166f6acd41fd89395d12697de01f8ee6c327790

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page