logxpy 0.1.0__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.
- logxpy/__init__.py +126 -0
- logxpy/_action.py +958 -0
- logxpy/_async.py +186 -0
- logxpy/_base.py +80 -0
- logxpy/_compat.py +71 -0
- logxpy/_config.py +45 -0
- logxpy/_dest.py +88 -0
- logxpy/_errors.py +58 -0
- logxpy/_fmt.py +68 -0
- logxpy/_generators.py +136 -0
- logxpy/_mask.py +23 -0
- logxpy/_message.py +195 -0
- logxpy/_output.py +517 -0
- logxpy/_pool.py +93 -0
- logxpy/_traceback.py +126 -0
- logxpy/_types.py +71 -0
- logxpy/_util.py +56 -0
- logxpy/_validation.py +486 -0
- logxpy/_version.py +21 -0
- logxpy/cli.py +61 -0
- logxpy/dask.py +172 -0
- logxpy/decorators.py +268 -0
- logxpy/filter.py +124 -0
- logxpy/journald.py +88 -0
- logxpy/json.py +149 -0
- logxpy/loggerx.py +253 -0
- logxpy/logwriter.py +84 -0
- logxpy/parse.py +191 -0
- logxpy/prettyprint.py +173 -0
- logxpy/serializers.py +36 -0
- logxpy/stdlib.py +23 -0
- logxpy/tai64n.py +45 -0
- logxpy/testing.py +472 -0
- logxpy/tests/__init__.py +9 -0
- logxpy/tests/common.py +36 -0
- logxpy/tests/strategies.py +231 -0
- logxpy/tests/test_action.py +1751 -0
- logxpy/tests/test_api.py +86 -0
- logxpy/tests/test_async.py +67 -0
- logxpy/tests/test_compat.py +13 -0
- logxpy/tests/test_config.py +21 -0
- logxpy/tests/test_coroutines.py +105 -0
- logxpy/tests/test_dask.py +211 -0
- logxpy/tests/test_decorators.py +54 -0
- logxpy/tests/test_filter.py +122 -0
- logxpy/tests/test_fmt.py +42 -0
- logxpy/tests/test_generators.py +292 -0
- logxpy/tests/test_journald.py +246 -0
- logxpy/tests/test_json.py +208 -0
- logxpy/tests/test_loggerx.py +44 -0
- logxpy/tests/test_logwriter.py +262 -0
- logxpy/tests/test_message.py +334 -0
- logxpy/tests/test_output.py +921 -0
- logxpy/tests/test_parse.py +309 -0
- logxpy/tests/test_pool.py +55 -0
- logxpy/tests/test_prettyprint.py +303 -0
- logxpy/tests/test_pyinstaller.py +35 -0
- logxpy/tests/test_serializers.py +36 -0
- logxpy/tests/test_stdlib.py +73 -0
- logxpy/tests/test_tai64n.py +66 -0
- logxpy/tests/test_testing.py +1051 -0
- logxpy/tests/test_traceback.py +251 -0
- logxpy/tests/test_twisted.py +814 -0
- logxpy/tests/test_util.py +45 -0
- logxpy/tests/test_validation.py +989 -0
- logxpy/twisted.py +265 -0
- logxpy-0.1.0.dist-info/METADATA +100 -0
- logxpy-0.1.0.dist-info/RECORD +72 -0
- logxpy-0.1.0.dist-info/WHEEL +5 -0
- logxpy-0.1.0.dist-info/entry_points.txt +2 -0
- logxpy-0.1.0.dist-info/licenses/LICENSE +201 -0
- logxpy-0.1.0.dist-info/top_level.txt +1 -0
logxpy/__init__.py
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Eliot: Logging for Complex & Distributed Systems.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from warnings import warn
|
|
6
|
+
|
|
7
|
+
# Expose the public API:
|
|
8
|
+
from ._message import Message
|
|
9
|
+
from ._action import (
|
|
10
|
+
Action,
|
|
11
|
+
current_action,
|
|
12
|
+
preserve_context,
|
|
13
|
+
start_action,
|
|
14
|
+
startTask,
|
|
15
|
+
)
|
|
16
|
+
from ._compat import log_call, log_message
|
|
17
|
+
from ._async import aaction
|
|
18
|
+
from ._output import FileDestination, ILogger, Logger, MemoryLogger, to_file
|
|
19
|
+
from ._traceback import write_traceback, writeFailure
|
|
20
|
+
from ._validation import ActionType, Field, MessageType, ValidationError, fields
|
|
21
|
+
from .loggerx import log
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# Backwards compatibility:
|
|
25
|
+
def add_destination(destination):
|
|
26
|
+
warn(
|
|
27
|
+
"add_destination is deprecated since 1.1.0. Use add_destinations instead.",
|
|
28
|
+
DeprecationWarning,
|
|
29
|
+
stacklevel=2,
|
|
30
|
+
)
|
|
31
|
+
Logger._destinations.add(destination)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
# Backwards compatibility:
|
|
35
|
+
def use_asyncio_context():
|
|
36
|
+
warn(
|
|
37
|
+
"This function is no longer as needed as of Eliot 1.8.0.",
|
|
38
|
+
DeprecationWarning,
|
|
39
|
+
stacklevel=2,
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
# Backwards compatibilty:
|
|
44
|
+
addDestination = add_destination
|
|
45
|
+
removeDestination = Logger._destinations.remove
|
|
46
|
+
addGlobalFields = Logger._destinations.addGlobalFields
|
|
47
|
+
writeTraceback = write_traceback
|
|
48
|
+
startAction = start_action
|
|
49
|
+
|
|
50
|
+
# PEP 8 variants:
|
|
51
|
+
start_task = startTask
|
|
52
|
+
write_failure = writeFailure
|
|
53
|
+
add_destinations = Logger._destinations.add
|
|
54
|
+
remove_destination = removeDestination
|
|
55
|
+
add_global_fields = addGlobalFields
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
# Backwards compatibility for old versions of eliot-tree, which rely on
|
|
59
|
+
# eliot._parse:
|
|
60
|
+
def _parse_compat():
|
|
61
|
+
# Force eliot.parse to be imported in way that works with old Python:
|
|
62
|
+
from .parse import Parser
|
|
63
|
+
|
|
64
|
+
del Parser
|
|
65
|
+
import sys
|
|
66
|
+
|
|
67
|
+
# Map both eliot.parse and logxpy.parse for compatibility
|
|
68
|
+
current_module = sys.modules.get("logxpy.parse") or sys.modules.get("eliot.parse")
|
|
69
|
+
if current_module:
|
|
70
|
+
sys.modules["eliot._parse"] = current_module
|
|
71
|
+
sys.modules["eliot.parse"] = current_module
|
|
72
|
+
sys.modules["logxpy._parse"] = current_module
|
|
73
|
+
return current_module
|
|
74
|
+
return None
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
_parse = _parse_compat()
|
|
78
|
+
del _parse_compat
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
__all__ = [
|
|
82
|
+
"Message",
|
|
83
|
+
"writeTraceback",
|
|
84
|
+
"writeFailure",
|
|
85
|
+
"startAction",
|
|
86
|
+
"startTask",
|
|
87
|
+
"Action",
|
|
88
|
+
"preserve_context",
|
|
89
|
+
"Field",
|
|
90
|
+
"fields",
|
|
91
|
+
"MessageType",
|
|
92
|
+
"ActionType",
|
|
93
|
+
"ILogger",
|
|
94
|
+
"Logger",
|
|
95
|
+
"MemoryLogger",
|
|
96
|
+
"addDestination",
|
|
97
|
+
"removeDestination",
|
|
98
|
+
"addGlobalFields",
|
|
99
|
+
"FileDestination",
|
|
100
|
+
"register_exception_extractor",
|
|
101
|
+
"current_action",
|
|
102
|
+
"use_asyncio_context",
|
|
103
|
+
"ValidationError",
|
|
104
|
+
# PEP 8 variants:
|
|
105
|
+
"write_traceback",
|
|
106
|
+
"write_failure",
|
|
107
|
+
"start_action",
|
|
108
|
+
"start_task",
|
|
109
|
+
"add_destination",
|
|
110
|
+
"add_destinations",
|
|
111
|
+
"remove_destination",
|
|
112
|
+
"add_global_fields",
|
|
113
|
+
"to_file",
|
|
114
|
+
"log_call",
|
|
115
|
+
"log_message",
|
|
116
|
+
"__version__",
|
|
117
|
+
"log",
|
|
118
|
+
"aaction",
|
|
119
|
+
# Backwards compat for eliot-tree:
|
|
120
|
+
"_parse",
|
|
121
|
+
]
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
from . import _version
|
|
125
|
+
|
|
126
|
+
__version__ = _version.get_versions()["version"]
|