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-0.0.7.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-0.0.7-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: python-just-logger-0.0.7.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-0.0.7.tar.gz
Algorithm Hash digest
SHA256 1b79aad894083747b8015426bfa2c1ffeca96eb2e6b1f07c8214f90f84f03644
MD5 9f507dde07ba0474f580f23b289c3a3a
BLAKE2b-256 a547f0a27c535323dcc7f47c817c75cde0bad9a0a09125784a2b09ab0fdd88d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_just_logger-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 026b9494c363f630394fdc988856dd4a6bcb15be204e688e9ab74fa463afdcda
MD5 c5cb63b5ea564335cbfb3242f23b8593
BLAKE2b-256 eb3efb8a8458785bd3c442b795baf935103ecf0950afedb846842ddaf196cbcf

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