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

Uploaded Python 3

File details

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

File metadata

  • Download URL: python-just-logger-1.1.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.1.0.tar.gz
Algorithm Hash digest
SHA256 a94da35312d52778a79d42003b5be60c3ad01f2da84808a369ab3fb1f801a048
MD5 47ab9087947ad4828e134f4784351d30
BLAKE2b-256 c6765972c0d5bb1cdc2f1f4ebb54e692d88919b6982a07a378f89f61e4bc6906

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_just_logger-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e1df547099c3bfb9b0735f5318455dd245b3cf5cbc459024f519a905eba92424
MD5 d03fd65b7bec98df9a9aebc325d1ee34
BLAKE2b-256 d20a5f4a9689c4bcbbb84791459657e215acbe296220cb807cbc22723548456d

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