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

Uploaded Python 3

File details

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

File metadata

  • Download URL: python-just-logger-0.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-0.0.0.tar.gz
Algorithm Hash digest
SHA256 aa7d20453b8018aaffec62be4bdba1d59d42391208fbd20f81ce2444001633a4
MD5 f3638fb3afac74667ce743140702ac51
BLAKE2b-256 04d63d4e9b45c7bf9b97ab0006e57c50e0b1125ac816ca776174592c6d2593b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for python_just_logger-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2742b23032cf80d5a090c34af9ae06a018d5c3ed54e4d0ec05e6faab1429a60d
MD5 90d26cadeaa1dfc6ba14df95db69a7f1
BLAKE2b-256 92c136161b18cb4787098a5ed6ad1c8823ca13f882446ecfde616785be9d8c34

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