Skip to main content

No project description provided

Project description

\n # Just Logger


This is a library featuring a simple logger for Python 3.

Features


  • Add Log by Type ✔️
  • Save Log's to file ✔️
  • Filter Log's by Type ✔️
  • Configure by .env ✔️

Using


Here's how you can use this library to log events. First, let's understand the options for Levels and Filters.

Levels

class LogLevel(Enum):
  INFO = "INFO"
  WARNING = "WARNING"
  ERROR = "ERROR"
  CRITICAL = "CRITICAL"

Filters

class LogFilter(Enum):
  ONLY_INFO = [LogLevel.INFO]
  ONLY_WARNING = [LogLevel.WARNING]
  ONLY_ERROR = [LogLevel.ERROR]
  ONLY_CRITICAL = [LogLevel.CRITICAL]
  DEBUG = [LogLevel.INFO, LogLevel.WARNING, LogLevel.ERROR, LogLevel.CRITICAL]
  PROD = [LogLevel.WARNING, LogLevel.ERROR]

Creating a Log

To create a log, first you must instantiate a Logger class. Then, create logs at the key points in your code.

from just_logger import logging as jl

logger = jl.Logger(log_file="logs/log.log")

logger.info("This is an info message")
# | 2024-02-26T08:43:06.094567 - INFO: This is an info message |                                                                                        

This example demonstrates how to use the library to log an informational message.

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

python-just-logger-1.0.0.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.

python_just_logger-1.0.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file python-just-logger-1.0.0.tar.gz.

File metadata

  • Download URL: python-just-logger-1.0.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for python-just-logger-1.0.0.tar.gz
Algorithm Hash digest
SHA256 567cb4f12efd77dc0b45deeb08834254c5ff4bd7540396a5b12432dd97b4f4e6
MD5 d09a7546ac765ae2482b9b467116a27d
BLAKE2b-256 82ea67c3eaa48396f00d20f2174f8cfcce508068be299853069b0a5efba68704

See more details on using hashes here.

File details

Details for the file python_just_logger-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for python_just_logger-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1380d78c67f163ebe6409d7f30b7c189a93d47f0afd51db3b4deaf7756bf69f0
MD5 580f86dc9b49244dd83d2c59a535328c
BLAKE2b-256 a7d5602472eb1ce427071a5fc49072d525db311d6efcb2f47f7557a47615be5f

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