Skip to main content

Add your description here

Project description

UsefulLog

Yet another logging library - made by BravestCheetah, Used by BravestCheetah

The main class

Everything in this library builds upon the Logger class: from usefullog.logger import Logger

The Logger Class

To use the tool you first gotta initialize an instance of the Logger class, you can do it just like this, including the name of the project:

logger = Logger("My Awesome Project")

When logging simple data like this: logger.log("cool logs") youll get some output like this:

2025-08-16 12:51:00 ( Test ) | [LOG] cool logs

There are other log formats too! Here they are:

.info("This is some info") - 2025-08-16 12:51:00 ( Test ) | [INFO] This is some info

.warn("You have been warned!") - 2025-08-16 12:51:00 ( Test ) | [WARN] You have been warned!

.error("Something went wrong :(") - 2025-08-16 12:51:00 ( Test ) | [ERROR] Something went wrong :(

.critical("CRITICAL ERROR") - 2025-08-16 12:51:00 ( Test ) | [CRITICAL] CRITICAL ERROR

.raw("only contents :O") - only contents :O

.space() - Newline (\n)

All logs are colored using the termcolor library which should be compatible with your terminal - Not visible in the documentation, but its there :D

Customization

But the logger does have multiple optional arguments to customize your logs. Lets list them:

1. Subname - Logger("My Awesome Project", sub_name="cool subsystem")

Result: 2025-08-16 12:55:19 ( Test/cool subsystem ) | [LOG] This is a test log

Useful for separating different systems or parts of your codebase for easier debugging.

2. Disable Timestamps - logger = Logger("Test", do_timestamps=False)

Result: ( Test ) | [LOG] This is a test log

Useful to declutter logs if timestamps arent necessary, makes the logs look more clean

3. Save Logs - logger = Logger("Test", do_log_saving=True)

Saves Logs Into .log files by default in the /logs folder. Each new instance of the Logger class creates a new log file.

Useful for saving and sharing logs

4. Disable Log Printing - logger = Logger("Test", print_logs=False)

Disables printing for logs, when paired with log saving you can safely store logs without filling the terminal.

5. Color Saved Logs - logger = Logger("Test", do_saved_log_decolouring=False)

When False the argument will keep the coloruing characters in the save folder, though most text editors may display these as normal characters and not colour them colours can be viewed when using a tool like cat to print the contents to the terminal directly.

6. Change Log Folder - logger = Logger("Test", log_save_folder="other folder")

When used logs will be saved in that path instead of the default /logs

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

usefullog-0.8.6.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

usefullog-0.8.6-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file usefullog-0.8.6.tar.gz.

File metadata

  • Download URL: usefullog-0.8.6.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.11

File hashes

Hashes for usefullog-0.8.6.tar.gz
Algorithm Hash digest
SHA256 6a1a93b8c30e417193f5cb1d5116f667f3c808b6e4614e756436ca439b77b45e
MD5 c2d70929abbd6806d3e4db8666767f1e
BLAKE2b-256 bee895bace8bd4c5b0f898f50aa8c6b85ff6a290643538054455281e8bd7edd7

See more details on using hashes here.

File details

Details for the file usefullog-0.8.6-py3-none-any.whl.

File metadata

  • Download URL: usefullog-0.8.6-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.11

File hashes

Hashes for usefullog-0.8.6-py3-none-any.whl
Algorithm Hash digest
SHA256 305cf8ba5663c6191ef78b38d732091dce3062c8e8c9f9306f7a2ce5ac6b46f7
MD5 fd2be3e9f02ba307d28dcf395f4dde50
BLAKE2b-256 07b5de88fece85ac283430a89450e2310c9ddbe2f1c56c28f84cee7d4e438a37

See more details on using hashes here.

Supported by

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