Simple decorator-logger
Project description
Decorator Logging Library
What is this?
The module allows you to wrap function with a logger (based on loguru) and specify some additional options (log level, log timing)
Using
class Roles:
def __init__(self, file_name: str):
self.file_name = file_name
self.roles = self.read()
@SyncLoggable()
def add_role(self, user_id: int, role: Role) -> None:
user_roles = self.roles.get(user_id, [])
user_roles.append(role)
self.roles[user_id] = user_roles
self.save()
def save(self) -> None:
...
def read(self) -> dict[int, list[Role]]:
...
example output for add_role(123, Role.ADMIN):
INFO: Executing add_role with args: ['123', 'Role.ADMIN']}
INFO: Success add_role returned: None
Developer
GitHub: link
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
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 decorator_logger-1.0.2.tar.gz.
File metadata
- Download URL: decorator_logger-1.0.2.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
565f7c00fe544bb41506cb23540402d2cdbd3397f0c6a5731763051c740c54af
|
|
| MD5 |
7b98dd51dfab427848816728b4bff251
|
|
| BLAKE2b-256 |
7ca02a01b30927046d69a8409cb01b82cb3eab16de7319111b101a81096eca8c
|
File details
Details for the file decorator_logger-1.0.2-py3-none-any.whl.
File metadata
- Download URL: decorator_logger-1.0.2-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81250e73cc5227f5d11c0b840925aeb5f7ecb4d558837cb43e220898847ea234
|
|
| MD5 |
2330b3b08b6e2b178d35c0d0f26ee152
|
|
| BLAKE2b-256 |
884dd51679aa3291e8b694e3d04d97f488c1728731db4ed49b9b8e32c954243d
|