inspy-logger 3.0.2.dev1__tar.gz → 3.0.3__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.
- {inspy_logger-3.0.2.dev1 → inspy_logger-3.0.3}/PKG-INFO +2 -2
- {inspy_logger-3.0.2.dev1 → inspy_logger-3.0.3}/inspy_logger/Scripts/main.py +4 -11
- {inspy_logger-3.0.2.dev1 → inspy_logger-3.0.3}/inspy_logger/__about__.py +7 -3
- inspy_logger-3.0.3/inspy_logger/__init__.py +84 -0
- inspy_logger-3.0.3/inspy_logger/common/__init__.py +36 -0
- inspy_logger-3.0.3/inspy_logger/common/dirs.py +2 -0
- inspy_logger-3.0.3/inspy_logger/common/meta.py +38 -0
- inspy_logger-3.0.3/inspy_logger/engine/__init__.py +483 -0
- inspy_logger-3.0.3/inspy_logger/engine/handlers.py +50 -0
- {inspy_logger-3.0.2.dev1 → inspy_logger-3.0.3}/inspy_logger/helpers/__init__.py +70 -13
- {inspy_logger-3.0.2.dev1 → inspy_logger-3.0.3}/inspy_logger/helpers/base_classes.py +145 -146
- inspy_logger-3.0.3/inspy_logger/helpers/command_line/__init__.py +28 -0
- {inspy_logger-3.0.2.dev1 → inspy_logger-3.0.3}/inspy_logger/helpers/debug/environment.py +5 -0
- inspy_logger-3.0.3/inspy_logger/helpers/decorators.py +85 -0
- inspy_logger-3.0.3/inspy_logger/tool/__init__.py +0 -0
- inspy_logger-3.0.3/inspy_logger/tool/config/__init__.py +0 -0
- inspy_logger-3.0.3/inspy_logger/tool/config/arguments/__init__.py +56 -0
- {inspy_logger-3.0.2.dev1 → inspy_logger-3.0.3}/inspy_logger/version.py +4 -4
- {inspy_logger-3.0.2.dev1 → inspy_logger-3.0.3}/pyproject.toml +2 -2
- inspy_logger-3.0.2.dev1/inspy_logger/__init__.py +0 -343
- {inspy_logger-3.0.2.dev1 → inspy_logger-3.0.3}/LICENSE.md +0 -0
- {inspy_logger-3.0.2.dev1 → inspy_logger-3.0.3}/README.md +0 -0
- {inspy_logger-3.0.2.dev1 → inspy_logger-3.0.3}/inspy_logger/errors/__init__.py +0 -0
- {inspy_logger-3.0.2.dev1 → inspy_logger-3.0.3}/inspy_logger/helpers/debug/__init__.py +0 -0
- {inspy_logger-3.0.2.dev1 → inspy_logger-3.0.3}/inspy_logger/helpers/debug/system/__init__.py +0 -0
- {inspy_logger-3.0.2.dev1 → inspy_logger-3.0.3}/inspy_logger/helpers/debug/system/processor/__init__.py +0 -0
- {inspy_logger-3.0.2.dev1 → inspy_logger-3.0.3}/inspy_logger/helpers/debug/system/winx/__init__.py +0 -0
- {inspy_logger-3.0.2.dev1 → inspy_logger-3.0.3}/inspy_logger/helpers/network.py +0 -0
- {inspy_logger-3.0.2.dev1 → inspy_logger-3.0.3}/inspy_logger/helpers/units.py +0 -0
- {inspy_logger-3.0.2.dev1 → inspy_logger-3.0.3}/inspy_logger/manifest.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: inspy-logger
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.3
|
|
4
4
|
Summary: Colorable, scalable logger for CLI
|
|
5
5
|
Home-page: https://github.com/Inspyre-Softworks/inSPy-Logger
|
|
6
6
|
License: MIT
|
|
@@ -32,7 +32,7 @@ Requires-Dist: luddite (>=1.0.1,<2.0.0)
|
|
|
32
32
|
Requires-Dist: packaging (>=21.0,<22.0)
|
|
33
33
|
Requires-Dist: python-box (>=6.1.0,<7.0.0)
|
|
34
34
|
Requires-Dist: requests (>=2.28.1,<3.0.0)
|
|
35
|
-
Requires-Dist: rich (>=13.
|
|
35
|
+
Requires-Dist: rich (>=13.7.0,<14.0.0)
|
|
36
36
|
Requires-Dist: setuptools-autover (>=1.0.2,<2.0.0)
|
|
37
37
|
Project-URL: Documentation, https://inspy-logger.readthedocs.io/en/latest/
|
|
38
38
|
Project-URL: Repository, https://github.com/Inspyre-Softworks/inSPy-Logger
|
|
@@ -9,12 +9,12 @@ Author:
|
|
|
9
9
|
"""
|
|
10
10
|
INSPY_LOG_LEVEL = 'info'
|
|
11
11
|
|
|
12
|
+
PROGNAME = 'inspy-logger-tool'
|
|
13
|
+
|
|
12
14
|
from argparse import ArgumentParser
|
|
15
|
+
|
|
13
16
|
from inspy_logger.helpers.debug.environment import fetch_system_info
|
|
14
|
-
from inspy_logger.version import parse_version,
|
|
15
|
-
from rich import print
|
|
16
|
-
from rich.table import Table
|
|
17
|
-
import sys
|
|
17
|
+
from inspy_logger.version import parse_version, PyPiVersionInfo
|
|
18
18
|
|
|
19
19
|
# ---- SET UP PARSER --------------------------------
|
|
20
20
|
|
|
@@ -60,9 +60,6 @@ else:
|
|
|
60
60
|
INCLUDE_PRE_RELEASE_FOR_UPDATE_CHECK = False
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
63
|
def main():
|
|
67
64
|
|
|
68
65
|
version = PyPiVersionInfo()
|
|
@@ -94,10 +91,6 @@ def main():
|
|
|
94
91
|
|
|
95
92
|
|
|
96
93
|
|
|
97
|
-
if parsed_args.subcommand in ACTIONS:
|
|
98
|
-
ACTIONS[parsed_args.subcommand]()
|
|
99
|
-
|
|
100
|
-
|
|
101
94
|
|
|
102
95
|
return parsed_args
|
|
103
96
|
|
|
@@ -11,11 +11,15 @@ Since:
|
|
|
11
11
|
v2.1.1
|
|
12
12
|
|
|
13
13
|
"""
|
|
14
|
+
from typing import List, Tuple
|
|
15
|
+
|
|
14
16
|
from inspy_logger.version import parse_version
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
__PROG__ = 'inSPy-Logger'
|
|
19
|
+
__VERSION__: str = parse_version()
|
|
20
|
+
__AUTHORS__: list[tuple[str, str]] = [
|
|
19
21
|
('Inspyre-Softworks', 'https://inspyre.tech'),
|
|
20
22
|
('Taylor-Jayde Blackstone', '<t.blackstone@inspyre.tech')
|
|
21
23
|
]
|
|
24
|
+
|
|
25
|
+
SOFTWARE_ORG = __AUTHORS__[0][0]
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
import sys
|
|
3
|
+
from inspy_logger.common import PROG_NAME, DEFAULT_LOGGING_LEVEL
|
|
4
|
+
from inspy_logger.helpers import find_variable_in_call_stack, check_preemptive_level_set, find_argument_parser
|
|
5
|
+
|
|
6
|
+
from inspy_logger.helpers import (
|
|
7
|
+
translate_to_logging_level,
|
|
8
|
+
clean_module_name,
|
|
9
|
+
CustomFormatter,
|
|
10
|
+
determine_client_prog_name,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
from inspy_logger.engine import Logger
|
|
14
|
+
|
|
15
|
+
__all__ = [
|
|
16
|
+
"clean_module_name",
|
|
17
|
+
"client_prog_name",
|
|
18
|
+
"CustomFormatter",
|
|
19
|
+
"DEFAULT_LOGGING_LEVEL",
|
|
20
|
+
"determine_level",
|
|
21
|
+
"InspyLogger",
|
|
22
|
+
"LOG_DEVICE",
|
|
23
|
+
"Logger",
|
|
24
|
+
"PROG_NAME",
|
|
25
|
+
"translate_to_logging_level",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
LOG_DEVICE = Logger(PROG_NAME)
|
|
29
|
+
|
|
30
|
+
MODULE_OBJ = sys.modules[__name__]
|
|
31
|
+
|
|
32
|
+
client_prog_name = determine_client_prog_name()
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def determine_level():
|
|
37
|
+
"""
|
|
38
|
+
Determines the level at which to output logs to the console.
|
|
39
|
+
|
|
40
|
+
Returns:
|
|
41
|
+
int:
|
|
42
|
+
The level at which to output logs to the console.
|
|
43
|
+
"""
|
|
44
|
+
global client_prog_name
|
|
45
|
+
level = DEFAULT_LOGGING_LEVEL
|
|
46
|
+
|
|
47
|
+
if _preemptive_set := check_preemptive_level_set():
|
|
48
|
+
level = translate_to_logging_level(_preemptive_set)
|
|
49
|
+
|
|
50
|
+
if client_prog_name:
|
|
51
|
+
if arg_parser := find_argument_parser():
|
|
52
|
+
from inspy_logger.helpers.command_line import add_argument
|
|
53
|
+
add_argument(arg_parser, level)
|
|
54
|
+
args = arg_parser.parse_args()
|
|
55
|
+
|
|
56
|
+
level = translate_to_logging_level(args.log_level)
|
|
57
|
+
|
|
58
|
+
return level
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
LOG_DEVICE.set_level(determine_level())
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
if client_prog_name:
|
|
65
|
+
PROG_LOGGER = Logger(client_prog_name, LOG_DEVICE.console_level, LOG_DEVICE.file_level)
|
|
66
|
+
__all__.append('PROG_LOGGER')
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
InspyLogger = Logger
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def _get_loggable():
|
|
73
|
+
from inspy_logger.helpers.base_classes import Loggable
|
|
74
|
+
import bisect
|
|
75
|
+
# Add the `Loggable` class to `__all__` in alphabetical order.
|
|
76
|
+
bisect.insort(__all__, 'Loggable')
|
|
77
|
+
|
|
78
|
+
return Loggable
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
Loggable = _get_loggable()
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
LOG_DEVICE.replay_and_setup_handlers()
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
|
|
3
|
+
from inspy_logger.__about__ import __PROG__ as PROG_NAME, __VERSION__ as PROG_VERSION
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
__all__ = [
|
|
7
|
+
"PROG_NAME",
|
|
8
|
+
"PROG_VERSION",
|
|
9
|
+
"LEVEL_MAP",
|
|
10
|
+
"LEVELS",
|
|
11
|
+
"DEFAULT_LOGGING_LEVEL",
|
|
12
|
+
"InspyLogger"
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
LEVEL_MAP = {
|
|
17
|
+
'debug': logging.DEBUG,
|
|
18
|
+
'info': logging.INFO,
|
|
19
|
+
'warning': logging.WARNING,
|
|
20
|
+
'error': logging.ERROR,
|
|
21
|
+
'critical': logging.CRITICAL,
|
|
22
|
+
'fatal': logging.FATAL,
|
|
23
|
+
}
|
|
24
|
+
"""A mapping of level names to their corresponding logging levels."""
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
LEVELS = list(LEVEL_MAP.values())
|
|
28
|
+
"""The list of level names."""
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
DEFAULT_LOGGING_LEVEL = logging.DEBUG
|
|
32
|
+
"""The default logging level."""
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class InspyLogger:
|
|
36
|
+
pass
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
__all__ = [
|
|
2
|
+
'AUTHORS',
|
|
3
|
+
'RELEASE_MAP',
|
|
4
|
+
'URLS',
|
|
5
|
+
'VERSION'
|
|
6
|
+
]
|
|
7
|
+
|
|
8
|
+
URLS = dict(
|
|
9
|
+
developer_url='https://inspyre.tech',
|
|
10
|
+
docs_url='https://inspyre-toolbox.readthedocs.io/en/latest',
|
|
11
|
+
github_url='https://github.com/tayjaybabee/Inspyre-Toolbox',
|
|
12
|
+
pypi_url='https://pypi.org/project/inspyre-toolbox',
|
|
13
|
+
)
|
|
14
|
+
"""The URLs used in the project."""
|
|
15
|
+
|
|
16
|
+
AUTHORS = [
|
|
17
|
+
('Inspyre-Softworks', URLS['developer_url']),
|
|
18
|
+
('Taylor-Jayde Blackstone', '<t.blackstone@inspyre.tech>')
|
|
19
|
+
]
|
|
20
|
+
"""The authors of the project."""
|
|
21
|
+
|
|
22
|
+
RELEASE_MAP = {
|
|
23
|
+
'dev': 'Development Build',
|
|
24
|
+
'alpha': 'Alpha Build',
|
|
25
|
+
'beta': 'Beta Build',
|
|
26
|
+
'rc': 'Release Candidate Build',
|
|
27
|
+
'final': 'Final Release Build'
|
|
28
|
+
}
|
|
29
|
+
"""The release map for the project."""
|
|
30
|
+
|
|
31
|
+
VERSION = {
|
|
32
|
+
'major': 3,
|
|
33
|
+
'minor': 0,
|
|
34
|
+
'patch': 3,
|
|
35
|
+
'release': 'final',
|
|
36
|
+
'release_num': 0
|
|
37
|
+
}
|
|
38
|
+
"""The version information for the project."""
|