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

Uploaded Python 3

File details

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

File metadata

  • Download URL: apipy_logs-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 9087db355bd980be52a9dd416937483b61ae81a5dc5d7ad617ffc805e4064d56
MD5 b371f1d9cee06f36d860ff9c47bbf870
BLAKE2b-256 7c59142d4afc415f702f884925c93a66a42b7eeb0d9bd5c392fae751a5c58e55

See more details on using hashes here.

File details

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

File metadata

  • Download URL: apipy_logs-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.5 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9c4380888f02b2f7ee27dfe26cd5d94be21fcb53334b80fb33d1e986485b2301
MD5 5113e0224fb9ecd62dd0fc577f418c5d
BLAKE2b-256 6346d0b54c4ab623f5a88720950386a86eb9cebaed5d7ccb967798e51cd439b3

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