ADD logging for device init
This commit is contained in:
parent
2948610785
commit
cc094bb071
|
@ -78,6 +78,7 @@ startAdapter is cs cb cl = do
|
|||
ot <- getBtObjectTree cl
|
||||
state <- newMVar emptyState
|
||||
let dpy = displayIcon cb (iconFormatter is cs) state
|
||||
-- TODO if this fails it won't be logged
|
||||
forM_ (findAdapter ot) $ \adapter -> do
|
||||
-- set up adapter
|
||||
initAdapter state adapter cl
|
||||
|
@ -227,9 +228,12 @@ initAdapter
|
|||
-> m ()
|
||||
initAdapter state adapter client = do
|
||||
reply <- callGetPowered adapter client
|
||||
logInfo $ "initializing adapter at path " <> adapter_
|
||||
-- TODO this could fail if the variant is something weird; the only
|
||||
-- indication I will get is "NA"
|
||||
putPowered state $ fromSingletonVariant reply
|
||||
where
|
||||
adapter_ = displayWrapQuote $ displayObjectPath adapter
|
||||
|
||||
matchBTProperty
|
||||
:: (MonadReader env m, HasLogFunc env, MonadUnliftIO m)
|
||||
|
@ -310,7 +314,9 @@ addAndInitDevice
|
|||
addAndInitDevice state dpy device client = do
|
||||
res <- addDeviceListener state dpy device client
|
||||
case res of
|
||||
Just handler -> initDevice state handler device client
|
||||
Just handler -> do
|
||||
logInfo $ "initializing device at path " <> device_
|
||||
initDevice state handler device client
|
||||
Nothing -> logError $ "could not initialize device at path " <> device_
|
||||
where
|
||||
device_ = displayWrapQuote $ displayObjectPath device
|
||||
|
|
Loading…
Reference in New Issue