mirror of
https://github.com/azaion/loader.git
synced 2026-04-22 10:26:33 +00:00
Quality cleanup refactoring
Made-with: Cursor
This commit is contained in:
@@ -8,15 +8,10 @@ Centralizes shared configuration constants and provides the application-wide log
|
||||
|
||||
### Constants (cdef, module-level)
|
||||
|
||||
| Name | Type | Value |
|
||||
|------------------------|------|--------------------------------|
|
||||
| CONFIG_FILE | str | `"config.yaml"` |
|
||||
| QUEUE_CONFIG_FILENAME | str | `"secured-config.json"` |
|
||||
| AI_ONNX_MODEL_FILE | str | `"azaion.onnx"` |
|
||||
| CDN_CONFIG | str | `"cdn.yaml"` |
|
||||
| MODELS_FOLDER | str | `"models"` |
|
||||
| SMALL_SIZE_KB | int | `3` |
|
||||
| ALIGNMENT_WIDTH | int | `32` |
|
||||
| Name | Type | Value |
|
||||
|---------------|------|--------------|
|
||||
| CDN_CONFIG | str | `"cdn.yaml"` |
|
||||
| SMALL_SIZE_KB | int | `3` |
|
||||
|
||||
Note: `QUEUE_MAXSIZE`, `COMMANDS_QUEUE`, `ANNOTATIONS_QUEUE` are declared in the `.pxd` but not defined in the `.pyx` — they are unused in this codebase.
|
||||
|
||||
@@ -30,7 +25,7 @@ Note: `QUEUE_MAXSIZE`, `COMMANDS_QUEUE`, `ANNOTATIONS_QUEUE` are declared in the
|
||||
## Internal Logic
|
||||
|
||||
Loguru is configured with three sinks:
|
||||
- **File sink**: `Logs/log_loader_{date}.txt`, INFO level, daily rotation, 30-day retention, async (enqueue=True)
|
||||
- **File sink**: under `LOG_DIR`, path template `log_loader_{time:YYYYMMDD}.txt`, INFO level, daily rotation, 30-day retention, async (enqueue=True)
|
||||
- **Stdout sink**: DEBUG level, filtered to INFO/DEBUG/SUCCESS only, colorized
|
||||
- **Stderr sink**: WARNING+ level, colorized
|
||||
|
||||
@@ -39,7 +34,7 @@ Log format: `[HH:mm:ss LEVEL] message`
|
||||
## Dependencies
|
||||
|
||||
- **Internal**: none (leaf module)
|
||||
- **External**: `loguru` (0.7.3), `sys`, `time`
|
||||
- **External**: `loguru` (0.7.3), `os`, `sys`
|
||||
|
||||
## Consumers
|
||||
|
||||
@@ -53,7 +48,11 @@ None.
|
||||
|
||||
## Configuration
|
||||
|
||||
No env vars consumed directly. Log file path is hardcoded to `Logs/log_loader_{date}.txt`.
|
||||
| Env Variable | Default | Description |
|
||||
|--------------|---------|--------------------------------------|
|
||||
| LOG_DIR | `Logs` | Directory for daily log files |
|
||||
|
||||
The file sink uses Loguru’s `{time:YYYYMMDD}` in the filename under `LOG_DIR`.
|
||||
|
||||
## External Integrations
|
||||
|
||||
|
||||
Reference in New Issue
Block a user