https://github.com/anqorithm/zloggerkit
https://github.com/anqorithm/zloggerkit
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/anqorithm/zloggerkit
- Owner: anqorithm
- Created: 2025-01-16T07:55:58.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-01-16T08:49:13.000Z (4 months ago)
- Last Synced: 2025-05-06T23:39:58.393Z (13 days ago)
- Language: Python
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ZLoggerKit
A structured logging utility for Python applications with support for multiple subsystems, JSON formatting, and Saudi Arabia timezone.
## Features
- Structured logging with JSON support
- Multiple subsystem support (AUTH, DATABASE, CACHE, NETWORK, etc.)
- Saudi Arabia timezone support
- Network request/response logging
- File-based logging with daily rotation
- Singleton pattern per subsystem
- Type validation using Pydantic models
- Debug, Info, Warning, and Error log levels## Installation
### Using Poetry (Recommended)
1. Make sure you have Poetry installed:
```bash
curl -sSL https://install.python-poetry.org | python3 -
```2. Add ZLoggerKit to your project:
```bash
# Add ZLoggerKit as a dependency
poetry add zloggerkit# Or clone and install from source
git clone https://github.com/anqorithm/ZLoggerKit.git
cd ZLoggerKit
poetry install
```3. Activate the virtual environment:
```bash
poetry shell
```## Development Setup
1. Clone the repository:
```bash
git clone https://github.com/anqorithm/ZLoggerKit.git
cd ZLoggerKit
```2. Install dependencies with Poetry:
```bash
poetry install
```3. Run tests:
```bash
poetry run pytest
```4. Format code:
```bash
poetry run black .
poetry run isort .
```5. Check types:
```bash
poetry run mypy .
```## Project Structure
```mermaid
graph TD;
A[ZLoggerKit] --> B[AUTH Subsystem]
A --> C[DATABASE Subsystem]
A --> D[CACHE Subsystem]
A --> E[NETWORK Subsystem]
B --> F[Logger]
C --> F[Logger]
D --> F[Logger]
E --> F[Logger]
F --> G[JSON Formatter]
F --> H[File Handler]
F --> I[Console Handler]
F --> J[Saudi Arabia Timezone]
```## Logging Flow
```mermaid
sequenceDiagram
participant User
participant Logger
participant Formatter
participant Handler
participant TimezoneUser->>Logger: Log Message
Logger->>Formatter: Format Message
Formatter->>Handler: Handle Message
Handler->>Timezone: Apply Timezone
Timezone->>Handler: Return Timestamp
Handler->>Logger: Log Completed
```