Skip to main content

A package to create, read and delete your logs

Project description

apipy_logs

Version Python FastAPI SQLAlchemy MPL-2.0 license

apipy_logs is a python module to create, read and delete your logs

How i can use it ?

Importation

from fastapi_logs.log_manager import LogManager, log_manager

Type of log

LogManager.DEBUG      # Represents a debug message
LogManager.INFO       # Represents an information message
LogManager.WARNING    # Represents a warning message
LogManager.ERROR      # Represents an error message
LogManager.CRITICAL   # Represents a critical message

Methods

log_manager.create_log(level: str, module: str, request: Request, log: str)  # Used to create a log
log_manager.clear_logs()                                                     # Used to to clear the logs
log_manager.get_logs() -> list[str]:                                         # Used to to to get the today logs

Example

from fastapi_logs.log_manager import LogManager, log_manager

@router.get("/create-log")
async def example(
    request: Request,
    db: Session = Depends(get_db),
):
    """
    This endpoint is an example.
    """
    log_manager.create_log(
        LogManager.INFO,
        __file__,
        request,
        f"This is an example"
    )
    return {}

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

apipy_logs-0.1.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

apipy_logs-0.1.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file apipy_logs-0.1.0.tar.gz.

File metadata

  • Download URL: apipy_logs-0.1.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for apipy_logs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e06b5fd10f92315cfc693ef5a999a7c7073d4ad1e8a26824fbdf23c2b8338cfe
MD5 784fd259da5472cc49f6684a47cc3a81
BLAKE2b-256 aed75adb47a4384895586c9714622819a9e2f1c45b24754954d95337c684d2dd

See more details on using hashes here.

File details

Details for the file apipy_logs-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: apipy_logs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for apipy_logs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c7df145e394cf67f1cf65a970978ef57b3b1836b01ba98e4080bbc4f903e52f
MD5 1592becaba2d27c848ecf624e6e02ffd
BLAKE2b-256 e2666ce430380c36dd858e478c801406dc04b0c7cddb050b511d57ab2d6634ea

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