ADD logger for device listener
This commit is contained in:
parent
69ed4839da
commit
9d7ca49357
|
@ -74,8 +74,8 @@ instance Exec Device where
|
||||||
where
|
where
|
||||||
logName = "device@" <> Utf8Builder (encodeUtf8Builder iface)
|
logName = "device@" <> Utf8Builder (encodeUtf8Builder iface)
|
||||||
listener sys path = do
|
listener sys path = do
|
||||||
rule <- matchPropertyFull sys networkManagerBus (Just path)
|
res <- matchPropertyFull sys networkManagerBus (Just path)
|
||||||
-- TODO warn the user here rather than silently drop the listener
|
case res of
|
||||||
forM_ rule $ \r ->
|
Just rule -> startListener rule (getDeviceConnected path) matchStatus chooseColor' cb sys
|
||||||
startListener r (getDeviceConnected path) matchStatus chooseColor' cb sys
|
Nothing -> logError "could not start listener"
|
||||||
chooseColor' = return . (\s -> colorText colors s text) . (> 1)
|
chooseColor' = return . (\s -> colorText colors s text) . (> 1)
|
||||||
|
|
Loading…
Reference in New Issue