Common utilities for Earnbase services
Project description
Earnbase Common
Common utilities for Earnbase microservices.
Features
- Structured logging with JSON format
- Log rotation and error logging
- Development and production logging modes
- Sensitive data filtering
- Service information injection
Installation
pip install earnbase-common
Usage
Basic Usage
from earnbase_common.logging import setup_logging, get_logger
# Configure logging
setup_logging(
service_name="my-service",
log_file="logs/my-service.log",
log_level="INFO",
debug=False
)
# Get logger
logger = get_logger(__name__)
# Use logger
logger.info("Service started", extra={"version": "1.0.0"})
Configuration
The logging system can be configured with the following parameters:
service_name: Name of the servicelog_file: Path to log filelog_level: Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)debug: Debug mode flag (enables colored console output)
Development
- Clone the repository
- Install dependencies with PDM:
pdm install
- Run tests:
pdm run test
License
MIT License
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
earnbase_common-0.1.0.tar.gz
(4.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 earnbase_common-0.1.0.tar.gz.
File metadata
- Download URL: earnbase_common-0.1.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.22.1 CPython/3.10.16 Linux/6.8.0-49-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccfb774c63dc6e673eef0368db82f800ec360e77cabe57a75891100e332dac4e
|
|
| MD5 |
4a047a08bcf4c0280463fc3d2f76fa91
|
|
| BLAKE2b-256 |
321cef2394abc899626a2439628cbb229193b21e1f23e0c6d2254522110db79d
|
File details
Details for the file earnbase_common-0.1.0-py3-none-any.whl.
File metadata
- Download URL: earnbase_common-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.22.1 CPython/3.10.16 Linux/6.8.0-49-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a7fe368294f7a04ba86edd40eb951d82ca94e2020ff3af280bdab88d18f0127
|
|
| MD5 |
9d8758621d964581f909918863ccfcb6
|
|
| BLAKE2b-256 |
181c30b38786d969a5bb9ca26d91b569bd36c8d296581646e60e6a09e02a4d36
|