mirror of
https://github.com/unpoller/unpoller.git
synced 2026-03-31 06:33:57 -04:00
Add config option to suppress unknown device type messages
Adds log_unknown_types config option (default: false) to control logging of unknown UniFi device types. When disabled (default), unknown devices are silently ignored to reduce log volume. When enabled, they are logged as DEBUG messages instead of ERROR. Addresses issue #912. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -452,6 +452,8 @@ func (u *promUnifi) switchExport(r report, v any) {
|
||||
case *unifi.UsageByCountry:
|
||||
u.exportCountryTraffic(r, v)
|
||||
default:
|
||||
u.LogErrorf("invalid type: %T", v)
|
||||
if u.Collector.Poller().LogUnknownTypes {
|
||||
u.LogDebugf("unknown type: %T", v)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user