📚 docs + guess_icon logging

This commit is contained in:
jokob-sk
2024-10-18 08:00:27 +11:00
parent a3aa81f369
commit 56f1e6adf8
3 changed files with 30 additions and 3 deletions

View File

@@ -76,3 +76,16 @@ In the above output notice the section logging how many events are produced by t
These values, if formatted correctly, will also show up in the UI:
![Plugins table](/docs/img/DEBUG_PLUGINS/plugin_objects_pihole.png)
### Sharing application state
Sometimes specific log sections are needed to debug issues. The Devices and CurrentScan table data is sometimes needed to figure out what's wrong.
1. Please set `LOG_LEVEL` to `trace` (Disable it once you have the info as this produces big log files).
2. Wait for the issue to occur.
3. Search for `================ DEVICES table content ================` in your logs.
4. Search for `================ CurrentScan table content ================` in your logs.
5. Open a new issue and post (redacted) output into the issue description (or send to the netalertx@gmail.com email if sensitive data present).
6. Please set `LOG_LEVEL` to `debug` or lower.

View File

@@ -49,6 +49,17 @@ services:
# Other service configurations...
```
## 5. Sharing application state
Sometimes specific log sections are needed to debug issues. The Devices and CurrentScan table data is sometimes needed to figure out what's wrong.
1. Please set `LOG_LEVEL` to `trace` (Disable it once you have the info as this produces big log files).
2. Wait for the issue to occur.
3. Search for `================ DEVICES table content ================` in your logs.
4. Search for `================ CurrentScan table content ================` in your logs.
5. Open a new issue and post (redacted) output into the issue description (or send to the netalertx@gmail.com email if sensitive data present).
6. Please set `LOG_LEVEL` to `debug` or lower.
## 📃Common issues
### Permissions

View File

@@ -459,7 +459,7 @@ def update_devices_data_from_scan (db):
default_icon = get_setting_value('NEWDEV_dev_Icon')
for device in sql.execute (query) :
# Conditional logic for dev_Icon guessing
# Conditional logic for dev_Icon guessing
dev_Icon = guess_icon(device['dev_Vendor'], device['dev_MAC'], device['dev_LastIP'], device['dev_Name'], default_icon)
recordsToUpdate.append ([dev_Icon, device['dev_MAC']])
@@ -677,7 +677,10 @@ icons = {
#-------------------------------------------------------------------------------
# Guess device icon
def guess_icon(vendor, mac, ip, name, default):
def guess_icon(vendor, mac, ip, name, default):
mylog('debug', [f"[guess_icon] Guessing icon for (vendor|mac|ip|name): ('{vendor}'|'{mac}'|{ip}|{name})"])
result = default
mac = mac.upper()
vendor = vendor.lower() if vendor else "unknown"
@@ -706,7 +709,7 @@ def guess_icon(vendor, mac, ip, name, default):
result = icons.get("microchip")
# Guess icon based on MAC address patterns
elif mac == "INTERNET": # Apple
elif mac == "INTERNET":
result = icons.get("globe")
elif mac.startswith("00:1A:79"): # Apple
result = icons.get("apple")