A package to create, read and delete your logs
Project description
apipy_logs
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
Release history Release notifications | RSS feed
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.1.tar.gz
(8.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file apipy_logs-0.1.1.tar.gz.
File metadata
- Download URL: apipy_logs-0.1.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6099139f3205c11d8b9ca6557e264e43b24f9eb9cd813262ac15736187dc0a60
|
|
| MD5 |
4167157ac3ce57be8acc8f38ecec2692
|
|
| BLAKE2b-256 |
07876a0698a4e4a5cd7bf12eb035c2f0eb1beb963aca5c2f2ddad728e41a9920
|
File details
Details for the file apipy_logs-0.1.1-py3-none-any.whl.
File metadata
- Download URL: apipy_logs-0.1.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f970ca07201130654c678c30bf8a865e3a4f6ba03ac885b22d28cb5ac03cade
|
|
| MD5 |
a1050d36bc890e77f54d48f401ab5987
|
|
| BLAKE2b-256 |
bf2b2384fc4749cf88ecd29a1cbf93956d62dcd766df2f1bc60d811d259d95d5
|