Skip to main content

A great colored logger!

Project description

BetterLogger

The best option for customizable and simplicity!

Config

All parts of the logger can be configured via environment variables.

Required

  • "APPNAME" - defaults to "BetterLogger"
  • "APPAUTHOR" - defaults to "BetterLogger"
  • "APPVERSION" - defaults to "1.0"
  • "SHORT_APPNAME" - defaults to "BL"

Logging Stuff

  • "LOG_LEVEL" - defaults to 10
  • "LOG_FORMAT" - defaults to "%LEVEL_COLOR[%BOLD{level: <10}]%RESET %LEVEL_COLOR[%BOLD{class_name: <32}]%RESET %LEVEL_COLOR {message}%RESET"
  • "DISABLE_WELCOME_LOGGING" -
    • BetterLogger sends some welcome text to introduce the program and to test the logger welcome logging example
    • defaults to False
  • "LOG_WHITELIST_ON" -
    • Turns on the log whitelist
    • Defaults to False
  • "LOG_WHITELIST" -
    • Choose which log names to be allowed through
    • Defaults to []
  • "LOG_BLACKLIST" -
    • Choose which log names to be filtered out
    • Overrules values in "LOG_WHITELIST"
    • Defaults to []
  • "LOG_NAMES_TO_SHORTEN" -
    • An array where the key is the item that needs shortening and the value is the shortened value
    • Defaults to {}

Saving Logs

  • "LOG_SAVE_DIR" - defaults to appdirs.user_log_dir(appname=appname, appauthor=appauthor, version=appversion)
  • "LOG_FILE_NAME_FORMAT" - defaults to "{appname}_{year}-{day}-{hour}-{minute}_{number}.log"

Colors

BetterLogger comes with 9 colors, and 2 other text modifiers. There is black, red, green, yellow, blue, magenta, cyan, white, bold and reset. These can be accessed in logging by using the % sign and then writing the color name in all caps and then using the reset code, e.g. e.g. %REDHelloWorld%Reset

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

betterLogger-1.7.tar.gz (44.8 kB view details)

Uploaded Source

File details

Details for the file betterLogger-1.7.tar.gz.

File metadata

  • Download URL: betterLogger-1.7.tar.gz
  • Upload date:
  • Size: 44.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.5

File hashes

Hashes for betterLogger-1.7.tar.gz
Algorithm Hash digest
SHA256 806999e61f2433a9d4c0c03a1a876bb8f1ac55842c95948a48582ea1984fb367
MD5 ef1df2877dff67963956a249cd0438a9
BLAKE2b-256 d503c029e7b8b3b0657988f171d4e073e0bfc41a727d4f701edbd95a28ac1109

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