automizor 0.4.3__py3-none-any.whl → 0.4.4__py3-none-any.whl
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.
- automizor/__init__.py +1 -1
- automizor/log/__init__.py +10 -10
- automizor/log/_log.py +8 -4
- {automizor-0.4.3.dist-info → automizor-0.4.4.dist-info}/METADATA +1 -1
- {automizor-0.4.3.dist-info → automizor-0.4.4.dist-info}/RECORD +8 -8
- {automizor-0.4.3.dist-info → automizor-0.4.4.dist-info}/LICENSE +0 -0
- {automizor-0.4.3.dist-info → automizor-0.4.4.dist-info}/WHEEL +0 -0
- {automizor-0.4.3.dist-info → automizor-0.4.4.dist-info}/top_level.txt +0 -0
automizor/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
version = "0.4.
|
1
|
+
version = "0.4.4"
|
automizor/log/__init__.py
CHANGED
@@ -15,8 +15,8 @@ def debug(msg: VALUE):
|
|
15
15
|
Writes a debug log message with a level of "DEBUG".
|
16
16
|
|
17
17
|
Parameters:
|
18
|
-
msg (VALUE): The log message to write. This can be a boolean, string,
|
19
|
-
or
|
18
|
+
msg (VALUE): The log message to write. This can be a boolean, string, integer, float
|
19
|
+
or a JSON-serializable dictionary or list.
|
20
20
|
"""
|
21
21
|
|
22
22
|
_get_log().write_log("DEBUG", msg)
|
@@ -27,8 +27,8 @@ def info(msg: VALUE):
|
|
27
27
|
Writes an info log message with a level of "INFO".
|
28
28
|
|
29
29
|
Parameters:
|
30
|
-
msg (VALUE): The log message to write. This can be a boolean, string,
|
31
|
-
or
|
30
|
+
msg (VALUE): The log message to write. This can be a boolean, string, integer, float
|
31
|
+
or a JSON-serializable dictionary or list.
|
32
32
|
"""
|
33
33
|
|
34
34
|
_get_log().write_log("INFO", msg)
|
@@ -39,8 +39,8 @@ def warning(msg: VALUE):
|
|
39
39
|
Writes a warning log message with a level of "WARNING".
|
40
40
|
|
41
41
|
Parameters:
|
42
|
-
msg (VALUE): The log message to write. This can be a boolean, string,
|
43
|
-
or
|
42
|
+
msg (VALUE): The log message to write. This can be a boolean, string, integer, float
|
43
|
+
or a JSON-serializable dictionary or list.
|
44
44
|
"""
|
45
45
|
|
46
46
|
_get_log().write_log("WARNING", msg)
|
@@ -51,8 +51,8 @@ def error(msg: VALUE):
|
|
51
51
|
Writes an error log message with a level of "ERROR".
|
52
52
|
|
53
53
|
Parameters:
|
54
|
-
msg (VALUE): The log message to write. This can be a boolean, string,
|
55
|
-
or
|
54
|
+
msg (VALUE): The log message to write. This can be a boolean, string, integer, float
|
55
|
+
or a JSON-serializable dictionary or list.
|
56
56
|
"""
|
57
57
|
|
58
58
|
_get_log().write_log("ERROR", msg)
|
@@ -63,8 +63,8 @@ def critical(msg: VALUE):
|
|
63
63
|
Writes a critical log message with a level of "CRITICAL".
|
64
64
|
|
65
65
|
Parameters:
|
66
|
-
msg (VALUE): The log message to write. This can be a boolean, string,
|
67
|
-
or
|
66
|
+
msg (VALUE): The log message to write. This can be a boolean, string, integer, float
|
67
|
+
or a JSON-serializable dictionary or list.
|
68
68
|
"""
|
69
69
|
|
70
70
|
_get_log().write_log("CRITICAL", msg)
|
automizor/log/_log.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import json
|
2
2
|
import os
|
3
3
|
from datetime import datetime, timezone
|
4
|
-
from typing import Union
|
4
|
+
from typing import Dict, List, Union
|
5
5
|
|
6
6
|
LOG_LEVELS = {
|
7
7
|
"DEBUG": 1,
|
@@ -11,7 +11,8 @@ LOG_LEVELS = {
|
|
11
11
|
"CRITICAL": 5,
|
12
12
|
}
|
13
13
|
|
14
|
-
|
14
|
+
JSON = Union[str, int, float, bool, None, Dict[str, "JSON"], List["JSON"]]
|
15
|
+
VALUE = Union[str, int, float, bool, JSON]
|
15
16
|
|
16
17
|
|
17
18
|
class Log:
|
@@ -64,8 +65,8 @@ class Log:
|
|
64
65
|
Parameters:
|
65
66
|
level (str): The log level of the message. Valid log levels are "DEBUG", "INFO",
|
66
67
|
"WARNING", "ERROR", and "CRITICAL".
|
67
|
-
msg (VALUE): The log message to write. This can be a boolean, string,
|
68
|
-
or
|
68
|
+
msg (VALUE): The log message to write. This can be a boolean, string, integer, float
|
69
|
+
or a JSON-serializable dictionary or list.
|
69
70
|
|
70
71
|
Raises:
|
71
72
|
ValueError: If an invalid log level is provided.
|
@@ -86,6 +87,9 @@ class Log:
|
|
86
87
|
except json.JSONDecodeError:
|
87
88
|
pass
|
88
89
|
|
90
|
+
if isinstance(msg, (dict, list)):
|
91
|
+
msg = json.dumps(msg, ensure_ascii=False)
|
92
|
+
|
89
93
|
timestamp = datetime.now(timezone.utc).isoformat()
|
90
94
|
data.append({"level": level, "msg": msg, "timestamp": timestamp})
|
91
95
|
|
@@ -1,17 +1,17 @@
|
|
1
|
-
automizor/__init__.py,sha256=
|
1
|
+
automizor/__init__.py,sha256=Qk6wsgzl7cSMWWZ902odoQ-wBV5Fda2ShX82NN7uHzM,18
|
2
2
|
automizor/exceptions.py,sha256=P5imySIOtG3ZIk2kh41Yod4RnlgTj7Vf0P3M-RuxQJs,1382
|
3
3
|
automizor/job/__init__.py,sha256=DNRuT6cyPQBaPRG4vNalCmEvcJQl-73b5ZDFOfNOwIg,1019
|
4
4
|
automizor/job/_job.py,sha256=_-ehqPwJdY89mWm3_VAuh7KRJdv-8iUu6iMAzwGLHM0,5235
|
5
|
-
automizor/log/__init__.py,sha256=
|
6
|
-
automizor/log/_log.py,sha256=
|
5
|
+
automizor/log/__init__.py,sha256=gEr2SuwN1FgX1NMnbphjg8_gfSic9L15H3WC868A-TQ,2104
|
6
|
+
automizor/log/_log.py,sha256=P9jAFXVANs5bAGH6-S0pzuSbRKEcX8VlQ_3uu690awE,2948
|
7
7
|
automizor/storage/__init__.py,sha256=bEY2R0Vk0cqscKYNnX-MM222XrxbLXOvOSBDgFmVPLo,3984
|
8
8
|
automizor/storage/_storage.py,sha256=DXcARkFZ3edoDRrDiR02zkO7LmGkRtcKTHmgPsal0lc,10989
|
9
9
|
automizor/utils/__init__.py,sha256=2trRoR5lljYKbYdxmioSlvzajjQM0Wnoq3bvF9lEZ6w,811
|
10
10
|
automizor/vault/__init__.py,sha256=UjRiW3J0R9ABXc1gXIPyS3cqNCwMWxx0l-C0PsIg7R0,1699
|
11
11
|
automizor/vault/_container.py,sha256=-2y7kASigoIVAebuQBk-0R_sI4gfmvjsMLuMg_tR1xA,1945
|
12
12
|
automizor/vault/_vault.py,sha256=uRsjOjzsstZpYwJoHNg_cpv803Dzo4T2oF6hwiG3Eww,4688
|
13
|
-
automizor-0.4.
|
14
|
-
automizor-0.4.
|
15
|
-
automizor-0.4.
|
16
|
-
automizor-0.4.
|
17
|
-
automizor-0.4.
|
13
|
+
automizor-0.4.4.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
14
|
+
automizor-0.4.4.dist-info/METADATA,sha256=ov8bVxRLQVqu-Q5opOucEST3mEOJmQbpblVy1UF3fIA,668
|
15
|
+
automizor-0.4.4.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
16
|
+
automizor-0.4.4.dist-info/top_level.txt,sha256=gScDy4I3tP6BMYAsTAlBXrxVh3E00zV0UioxwXJOI3Y,10
|
17
|
+
automizor-0.4.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|