libsrg 6.2.0__tar.gz → 6.2.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.
- {libsrg-6.2.0 → libsrg-6.2.2}/PKG-INFO +1 -1
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg/LoggingCounter.py +8 -4
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg/Runner.py +2 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg.egg-info/PKG-INFO +1 -1
- {libsrg-6.2.0 → libsrg-6.2.2}/pyproject.toml +1 -1
- {libsrg-6.2.0 → libsrg-6.2.2}/README.md +0 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg/AppTemplate.py +0 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg/Config.py +0 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg/ElapsedTime.py +0 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg/Info.py +0 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg/LevelBanner.py +0 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg/LoggingAppBase.py +0 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg/LoggingUtils.py +0 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg/LoggingWatcher.py +0 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg/NagiosBase.py +0 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg/Runner2.py +0 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg/Statistics/ADStatsBase.py +0 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg/Statistics/AnalogStatsBase.py +0 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg/Statistics/AnalogStatsCumulative.py +0 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg/Statistics/AnalogStatsFading.py +0 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg/Statistics/AnalogStatsSlidingWindow.py +0 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg/Statistics/DiscreteStatsBase.py +0 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg/Statistics/DiscreteStatsCumulative.py +0 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg/Statistics/DiscreteStatsSlidingWindow.py +0 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg/Statistics/__init__.py +0 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg/__init__.py +0 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg.egg-info/SOURCES.txt +0 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg.egg-info/dependency_links.txt +0 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg.egg-info/requires.txt +0 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/libsrg.egg-info/top_level.txt +0 -0
- {libsrg-6.2.0 → libsrg-6.2.2}/setup.cfg +0 -0
|
@@ -12,7 +12,7 @@ import time
|
|
|
12
12
|
from collections import Counter
|
|
13
13
|
from importlib.metadata import version, PackageNotFoundError
|
|
14
14
|
from logging.handlers import RotatingFileHandler
|
|
15
|
-
from typing import List
|
|
15
|
+
from typing import List, Any
|
|
16
16
|
|
|
17
17
|
from libsrg.ElapsedTime import ElapsedTime
|
|
18
18
|
from libsrg.LevelBanner import LevelBanner
|
|
@@ -87,9 +87,7 @@ class LoggingCounter(logging.Handler):
|
|
|
87
87
|
lasttag = None
|
|
88
88
|
|
|
89
89
|
# allow for user defined levels
|
|
90
|
-
|
|
91
|
-
counter_nums = [logging.getLevelName(x) for x in counter_names]
|
|
92
|
-
ordered_names = [logging.getLevelName(x) for x in sorted(counter_nums)]
|
|
90
|
+
ordered_names = self.get_level_name_order()
|
|
93
91
|
# olist.append(f"\n{counter_names=}\n{counter_nums=}\n{ordered_names=}")
|
|
94
92
|
# ordered_names = ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]
|
|
95
93
|
for tag in ordered_names:
|
|
@@ -105,6 +103,12 @@ class LoggingCounter(logging.Handler):
|
|
|
105
103
|
logger.log(log_level, "\n".join(olist))
|
|
106
104
|
self.frozen = False
|
|
107
105
|
|
|
106
|
+
def get_level_name_order(self) -> list[Any]:
|
|
107
|
+
counter_names = self.count_at_level_name.keys()
|
|
108
|
+
counter_nums = [logging.getLevelName(x) for x in counter_names]
|
|
109
|
+
ordered_names = [logging.getLevelName(x) for x in sorted(counter_nums)]
|
|
110
|
+
return ordered_names
|
|
111
|
+
|
|
108
112
|
# noinspection PyPep8Naming
|
|
109
113
|
@classmethod
|
|
110
114
|
def config_and_attach(cls, filename: str = None, maxBytes: int = 10 * 1024 * 1024, backupCount: int = 5,
|
|
@@ -176,6 +176,8 @@ class Runner:
|
|
|
176
176
|
cstr = " ".join(self._cmd)
|
|
177
177
|
return f'Runner(success={self.success} ret={self.ret} cstr="{cstr}" runtime={self.runtime.elapsed():5.3f} so_lines={self.so_lines} se_lines={self.se_lines} userat={self.userat})'
|
|
178
178
|
|
|
179
|
+
def __repr__(self):
|
|
180
|
+
return str(self)
|
|
179
181
|
|
|
180
182
|
if __name__ == "__main__":
|
|
181
183
|
from libsrg.LoggingCounter import LoggingCounter
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|