mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-10-02 10:45:05 -04:00
BE: docstrings
This commit is contained in:
1 parent
c5081ba4c1
commit
f0a833ccc8
2 files changed
+7
No files matched your search
@@ -572,6 +572,11 @@ def save_own_device(db):
|
||||
|
||||
# -------------------------------------------------------------------------------
|
||||
def print_scan_stats(db):
|
||||
"""
|
||||
Log diagnostic scan-cycle counts (devices detected, new devices, down
|
||||
alerts, new connections, disconnections, IP changes, per-plugin scan
|
||||
method counts) at verbose/trace log levels. No return value.
|
||||
"""
|
||||
sql = db.sql # TO-DO
|
||||
|
||||
query = f"""
|
||||
|
||||
@@ -44,6 +44,8 @@ def _run_stats(conn, monkeypatch):
|
||||
logged = {}
|
||||
|
||||
def fake_mylog(level, parts):
|
||||
"""Stand in for logger.mylog: parse the down_alerts/new_down_alerts
|
||||
counts straight out of print_scan_stats()'s own log lines."""
|
||||
text = "".join(parts) if isinstance(parts, list) else str(parts)
|
||||
if "Down Alerts" in text and "New Down Alerts" not in text:
|
||||
logged["down_alerts"] = int(text.rsplit(":", 1)[1].strip())
|
||||
|
||||
Reference in new issue
Block a user