Skip to main content

Colorised logger for python, using logging python lib

Project description

MeowthPxnk Cxstom logger for python!


How this works:

Logs will be steram to console and save to rollover every hour at 00 minutes: savepath -> ./Logs/YYYY-MM-DD/HH.00-HH.00.log


Usage:

from MeowthLogger import Logger

logger = Logger()

# usage logger ---->

logger.info("INFO")
logger.error("ERROR")
logger.debug("DEBUG")
logger.warning("WARNING")
logger.critical("CRITICAL")

Initialisation arguments:

  • logger_level - level of logging
  • use_files - bool argument, if u don't need use logging files
  • path - logs folder path
  • filename - logging filename
  • encoding - encoding for log ro files
  • use_uvicorn - bool argument, need to use logger with uvicorn
Example:
logger = Logger(
    path="user/logs",
    filename="logging.log",
    encoding="utf-8"
)

Logs parsing:

Can use if active file system
date_from: datetime.datetime = ...
date_to: datetime.datetime.now()

logs: bytes = logger.parse_logs(date_from, date_to)

or without date_to

logs: bytes = logger.parse_logs(date_from)

Usage without file system:

logger = Logger(use_files=False)

Usage with dependencies:

Uvicorn -
logger = Logger(use_uvicorn=True)

$XOXO$ meowthpxnk

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

meowthlogger-2.2-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file meowthlogger-2.2-py3-none-any.whl.

File metadata

  • Download URL: meowthlogger-2.2-py3-none-any.whl
  • Upload date:
  • Size: 24.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.7

File hashes

Hashes for meowthlogger-2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 596cfa5ccd516aa1ff02f249f3c2d8f8bac9984f75c061a22f5c859b90d68745
MD5 1bbdf8d06b8f481aa6781a04e0061ef4
BLAKE2b-256 76a355b791812f6fbfcfc6ce4540757e50d1f8cd3a6cb02c06f1d2c49c1666d5

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