feat(usbgadget): suppress duplicate error logs (#630).

This commit is contained in:
Aveline
2025-06-20 18:52:37 +02:00
committed by GitHub
parent 0d7f47c109
commit 3e7d8fb0f5
5 changed files with 44 additions and 6 deletions

View File

@@ -79,6 +79,8 @@ type UsbGadget struct {
onKeyboardStateChange *func(state KeyboardState)
log *zerolog.Logger
logSuppressionCounter map[string]int
}
const configFSPath = "/sys/kernel/config"
@@ -126,6 +128,8 @@ func newUsbGadget(name string, configMap map[string]gadgetConfigItem, enabledDev
strictMode: config.strictMode,
logSuppressionCounter: make(map[string]int),
absMouseAccumulatedWheelY: 0,
}
if err := g.Init(); err != nil {