JSONL-LOGGER 0.0.1__tar.gz → 0.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {jsonl_logger-0.0.1 → jsonl_logger-0.0.2}/JSONL_LOGGER.egg-info/PKG-INFO +5 -5
- {jsonl_logger-0.0.1 → jsonl_logger-0.0.2}/JSONL_LOGGER.py +13 -13
- {jsonl_logger-0.0.1 → jsonl_logger-0.0.2}/PKG-INFO +5 -5
- {jsonl_logger-0.0.1 → jsonl_logger-0.0.2}/README.md +4 -4
- {jsonl_logger-0.0.1 → jsonl_logger-0.0.2}/pyproject.toml +1 -1
- {jsonl_logger-0.0.1 → jsonl_logger-0.0.2}/JSONL_LOGGER.egg-info/SOURCES.txt +0 -0
- {jsonl_logger-0.0.1 → jsonl_logger-0.0.2}/JSONL_LOGGER.egg-info/dependency_links.txt +0 -0
- {jsonl_logger-0.0.1 → jsonl_logger-0.0.2}/JSONL_LOGGER.egg-info/requires.txt +0 -0
- {jsonl_logger-0.0.1 → jsonl_logger-0.0.2}/JSONL_LOGGER.egg-info/top_level.txt +0 -0
- {jsonl_logger-0.0.1 → jsonl_logger-0.0.2}/LICENSE +0 -0
- {jsonl_logger-0.0.1 → jsonl_logger-0.0.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: JSONL-LOGGER
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.2
|
|
4
4
|
Summary: Async queue-based structured JSONL logging with thread-safe performance and auto-detected module names
|
|
5
5
|
Author-email: rocky <rocky@null.net>
|
|
6
6
|
License: MIT
|
|
@@ -95,9 +95,9 @@ await send_notification_async("Deployment completed", source_file="deploy.py")
|
|
|
95
95
|
|
|
96
96
|
### Output
|
|
97
97
|
```
|
|
98
|
-
{PROJECT_DIRECTORY}/
|
|
98
|
+
{PROJECT_DIRECTORY}/_ALGO_RECORDS/{EXCHANGE}/{YYYY_MM_DD}/LOGS/{logfile_name}.jsonl
|
|
99
99
|
```
|
|
100
|
-
Example: `/path/to/logs/
|
|
100
|
+
Example: `/path/to/logs/_ALGO_RECORDS/NSE/2026_04_03/LOGS/orders.jsonl`
|
|
101
101
|
|
|
102
102
|
### JSONL fields
|
|
103
103
|
`timestamp`, `timestamp_local`, `level`, `logfile_name`, `module_name`, `source_file`, `message`, `**extra_fields`
|
|
@@ -130,10 +130,10 @@ UTC: UTC
|
|
|
130
130
|
### File Structure
|
|
131
131
|
|
|
132
132
|
```
|
|
133
|
-
{PROJECT_DIRECTORY}/
|
|
133
|
+
{PROJECT_DIRECTORY}/_ALGO_RECORDS/{EXCHANGE}/{YYYY_MM_DD}/LOGS/{logfile_name}.jsonl
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
-
Example: `/path/to/logs/
|
|
136
|
+
Example: `/path/to/logs/_ALGO_RECORDS/NSE/2026_04_03/LOGS/orders.jsonl`
|
|
137
137
|
|
|
138
138
|
### JSONL Format
|
|
139
139
|
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
# send_notification("Application started", source_file="main.py")
|
|
34
34
|
# await send_notification_async("Deployment completed", source_file="deploy.py")
|
|
35
35
|
#
|
|
36
|
-
# Output: {PROJECT_DIRECTORY}/
|
|
36
|
+
# Output: {PROJECT_DIRECTORY}/_ALGO_RECORDS/{EXCHANGE}/{YYYY_MM_DD}/LOGS/{logfile_name}.jsonl
|
|
37
37
|
#
|
|
38
38
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
39
39
|
|
|
@@ -205,8 +205,8 @@ PROJECT_DIRECTORY: str = os.path.expandvars(os.getenv("PROJECT_DIRECTORY", ""))
|
|
|
205
205
|
# _get_log_path() with actionable message rather than silent write to wrong path
|
|
206
206
|
|
|
207
207
|
EXCHANGE: str = os.getenv("EXCHANGE", "")
|
|
208
|
-
# WHY: Exchange name inserted after
|
|
209
|
-
# (e.g. PROJECT_DIRECTORY/
|
|
208
|
+
# WHY: Exchange name inserted after _ALGO_RECORDS to namespace logs by exchange
|
|
209
|
+
# (e.g. PROJECT_DIRECTORY/_ALGO_RECORDS/NSE/...)
|
|
210
210
|
|
|
211
211
|
_DEFAULT_LOGFILE: str = "LOGS"
|
|
212
212
|
# WHY: Default logfile name — can override via LOGGER_FILE_NAME env var or explicit param
|
|
@@ -214,7 +214,7 @@ _DEFAULT_LOGFILE: str = "LOGS"
|
|
|
214
214
|
LOGS_LOCAL_TIMEZONE: str = os.getenv("LOGS_LOCAL_TIMEZONE", "")
|
|
215
215
|
# WHY: Local timezone for logging. Set via LOGS_LOCAL_TIMEZONE env var.
|
|
216
216
|
|
|
217
|
-
|
|
217
|
+
_ALGO_RECORDS: str = "_ALGO_RECORDS"
|
|
218
218
|
# WHY: Hardcoded — this is the one canonical log subdirectory for this project.
|
|
219
219
|
|
|
220
220
|
LOGGER_REGISTER_SIGNALS: bool = (
|
|
@@ -735,7 +735,7 @@ def _get_log_path(logfile_name: str | None = None, suffix: str = "") -> Path:
|
|
|
735
735
|
raise ValueError(f"PROJECT_DIRECTORY '{base_dir}' is not writable")
|
|
736
736
|
|
|
737
737
|
today = datetime.now(timezone.utc).strftime("%Y_%m_%d")
|
|
738
|
-
log_dir = base_dir /
|
|
738
|
+
log_dir = base_dir / _ALGO_RECORDS / EXCHANGE / today / "LOGS"
|
|
739
739
|
_ensure_directory(log_dir)
|
|
740
740
|
return log_dir / f"{logfile_name}{suffix}.jsonl"
|
|
741
741
|
|
|
@@ -777,12 +777,12 @@ if pytest is not None:
|
|
|
777
777
|
f"Expected 'does not exist' in error, got: {e!r}"
|
|
778
778
|
)
|
|
779
779
|
|
|
780
|
-
# ──
|
|
780
|
+
# ── _ALGO_RECORDS is always _ALGO_RECORDS — hardcoded ─────────────
|
|
781
781
|
with tempfile.TemporaryDirectory() as tmp:
|
|
782
782
|
with patch("JSONL_LOGGER.PROJECT_DIRECTORY", tmp):
|
|
783
783
|
result = _get_log_path("mymodule")
|
|
784
|
-
assert "
|
|
785
|
-
f"Expected '
|
|
784
|
+
assert "_ALGO_RECORDS" in str(result), (
|
|
785
|
+
f"Expected '_ALGO_RECORDS' in path, got: {result!r}"
|
|
786
786
|
)
|
|
787
787
|
|
|
788
788
|
# ── plain suffix="" produces {module}.jsonl ───────────────────────────
|
|
@@ -2551,9 +2551,9 @@ def run_performance_test(
|
|
|
2551
2551
|
# LOGGER_MAX_BUFFER_SIZE=200000 # Optional: per-file buffer cap (default: 200000)
|
|
2552
2552
|
#
|
|
2553
2553
|
# Output Location:
|
|
2554
|
-
# {PROJECT_DIRECTORY}/
|
|
2555
|
-
# {PROJECT_DIRECTORY}/
|
|
2556
|
-
# {PROJECT_DIRECTORY}/
|
|
2554
|
+
# {PROJECT_DIRECTORY}/_ALGO_RECORDS/{EXCHANGE}/{YYYY_MM_DD}/LOGS/{logfile_name}.jsonl ← all logs
|
|
2555
|
+
# {PROJECT_DIRECTORY}/_ALGO_RECORDS/{EXCHANGE}/{YYYY_MM_DD}/LOGS/{logfile_name}.errors.jsonl ← errors only
|
|
2556
|
+
# {PROJECT_DIRECTORY}/_ALGO_RECORDS/{EXCHANGE}/{YYYY_MM_DD}/LOGS/{logfile_name}.metrics.jsonl ← metrics
|
|
2557
2557
|
#
|
|
2558
2558
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
2559
2559
|
# GROUP MULTIPLE FILES UNDER ONE LOG FILE:
|
|
@@ -2568,7 +2568,7 @@ def run_performance_test(
|
|
|
2568
2568
|
# from JSONL_LOGGER import log_info
|
|
2569
2569
|
# log_info("Data fetched", records=1000)
|
|
2570
2570
|
#
|
|
2571
|
-
# Both write to: {PROJECT_DIRECTORY}/
|
|
2571
|
+
# Both write to: {PROJECT_DIRECTORY}/_ALGO_RECORDS/{EXCHANGE}/{date}/LOGS/TRADING.jsonl
|
|
2572
2572
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
2573
2573
|
# HIGH-THROUGHPUT CALLERS — bypass inspect overhead (~1-5µs saved per call):
|
|
2574
2574
|
#
|
|
@@ -2630,6 +2630,6 @@ if __name__ == "__main__":
|
|
|
2630
2630
|
|
|
2631
2631
|
print("\n" + "=" * 60)
|
|
2632
2632
|
print(
|
|
2633
|
-
f"✅ Done — check {os.environ['PROJECT_DIRECTORY']}/
|
|
2633
|
+
f"✅ Done — check {os.environ['PROJECT_DIRECTORY']}/_ALGO_RECORDS/{EXCHANGE}/ for JSONL files"
|
|
2634
2634
|
)
|
|
2635
2635
|
print("=" * 60)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: JSONL-LOGGER
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.2
|
|
4
4
|
Summary: Async queue-based structured JSONL logging with thread-safe performance and auto-detected module names
|
|
5
5
|
Author-email: rocky <rocky@null.net>
|
|
6
6
|
License: MIT
|
|
@@ -95,9 +95,9 @@ await send_notification_async("Deployment completed", source_file="deploy.py")
|
|
|
95
95
|
|
|
96
96
|
### Output
|
|
97
97
|
```
|
|
98
|
-
{PROJECT_DIRECTORY}/
|
|
98
|
+
{PROJECT_DIRECTORY}/_ALGO_RECORDS/{EXCHANGE}/{YYYY_MM_DD}/LOGS/{logfile_name}.jsonl
|
|
99
99
|
```
|
|
100
|
-
Example: `/path/to/logs/
|
|
100
|
+
Example: `/path/to/logs/_ALGO_RECORDS/NSE/2026_04_03/LOGS/orders.jsonl`
|
|
101
101
|
|
|
102
102
|
### JSONL fields
|
|
103
103
|
`timestamp`, `timestamp_local`, `level`, `logfile_name`, `module_name`, `source_file`, `message`, `**extra_fields`
|
|
@@ -130,10 +130,10 @@ UTC: UTC
|
|
|
130
130
|
### File Structure
|
|
131
131
|
|
|
132
132
|
```
|
|
133
|
-
{PROJECT_DIRECTORY}/
|
|
133
|
+
{PROJECT_DIRECTORY}/_ALGO_RECORDS/{EXCHANGE}/{YYYY_MM_DD}/LOGS/{logfile_name}.jsonl
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
-
Example: `/path/to/logs/
|
|
136
|
+
Example: `/path/to/logs/_ALGO_RECORDS/NSE/2026_04_03/LOGS/orders.jsonl`
|
|
137
137
|
|
|
138
138
|
### JSONL Format
|
|
139
139
|
|
|
@@ -68,9 +68,9 @@ await send_notification_async("Deployment completed", source_file="deploy.py")
|
|
|
68
68
|
|
|
69
69
|
### Output
|
|
70
70
|
```
|
|
71
|
-
{PROJECT_DIRECTORY}/
|
|
71
|
+
{PROJECT_DIRECTORY}/_ALGO_RECORDS/{EXCHANGE}/{YYYY_MM_DD}/LOGS/{logfile_name}.jsonl
|
|
72
72
|
```
|
|
73
|
-
Example: `/path/to/logs/
|
|
73
|
+
Example: `/path/to/logs/_ALGO_RECORDS/NSE/2026_04_03/LOGS/orders.jsonl`
|
|
74
74
|
|
|
75
75
|
### JSONL fields
|
|
76
76
|
`timestamp`, `timestamp_local`, `level`, `logfile_name`, `module_name`, `source_file`, `message`, `**extra_fields`
|
|
@@ -103,10 +103,10 @@ UTC: UTC
|
|
|
103
103
|
### File Structure
|
|
104
104
|
|
|
105
105
|
```
|
|
106
|
-
{PROJECT_DIRECTORY}/
|
|
106
|
+
{PROJECT_DIRECTORY}/_ALGO_RECORDS/{EXCHANGE}/{YYYY_MM_DD}/LOGS/{logfile_name}.jsonl
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
-
Example: `/path/to/logs/
|
|
109
|
+
Example: `/path/to/logs/_ALGO_RECORDS/NSE/2026_04_03/LOGS/orders.jsonl`
|
|
110
110
|
|
|
111
111
|
### JSONL Format
|
|
112
112
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "JSONL-LOGGER"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.2"
|
|
8
8
|
description = "Async queue-based structured JSONL logging with thread-safe performance and auto-detected module names"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|