logger-plugin 0.1.0__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.
@@ -0,0 +1,6 @@
1
+ Metadata-Version: 2.4
2
+ Name: logger-plugin
3
+ Version: 0.1.0
4
+ Summary: Add your description here
5
+ Requires-Python: >=3.12
6
+ Description-Content-Type: text/markdown
File without changes
@@ -0,0 +1,7 @@
1
+ [project]
2
+ name = "logger-plugin"
3
+ version = "0.1.0"
4
+ description = "Add your description here"
5
+ readme = "README.md"
6
+ requires-python = ">=3.12"
7
+ dependencies = []
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ from .main import log_operation
2
+
3
+ __all__ = ["log_operation"]
@@ -0,0 +1,6 @@
1
+ Metadata-Version: 2.4
2
+ Name: logger-plugin
3
+ Version: 0.1.0
4
+ Summary: Add your description here
5
+ Requires-Python: >=3.12
6
+ Description-Content-Type: text/markdown
@@ -0,0 +1,8 @@
1
+ README.md
2
+ pyproject.toml
3
+ src/__init__.py
4
+ src/main.py
5
+ src/logger_plugin.egg-info/PKG-INFO
6
+ src/logger_plugin.egg-info/SOURCES.txt
7
+ src/logger_plugin.egg-info/dependency_links.txt
8
+ src/logger_plugin.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ __init__
2
+ main
@@ -0,0 +1,31 @@
1
+ from functools import wraps
2
+ import time
3
+
4
+
5
+ def log_operation():
6
+
7
+ def decorator(func):
8
+
9
+ @wraps(func)
10
+ def wrapper(*args, **kwargs):
11
+
12
+ start_time = time.perf_counter()
13
+
14
+ operation = func.__name__
15
+
16
+ result = func(*args, **kwargs)
17
+
18
+ elapsed_ms = (time.perf_counter() - start_time) * 1000
19
+
20
+ print({
21
+ "operation": operation,
22
+ "parameters": args,
23
+ "result": result,
24
+ "execution_time_ms": round(elapsed_ms, 3)
25
+ })
26
+
27
+ return result
28
+
29
+ return wrapper
30
+
31
+ return decorator