aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/Keys
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2022-04-22 00:27:36 -0600
committerJosh Rahm <joshuarahm@gmail.com>2022-04-22 00:27:36 -0600
commitfd7831aba6f1698883906258a0a1966880427d94 (patch)
treeac6e9defe20a84ea5562e405eea54684e163f665 /src/Rahm/Desktop/Keys
parent8df47403a0f5ed1a3ef853e25868fa305b2f3a1b (diff)
downloadrde-fd7831aba6f1698883906258a0a1966880427d94.tar.gz
rde-fd7831aba6f1698883906258a0a1966880427d94.tar.bz2
rde-fd7831aba6f1698883906258a0a1966880427d94.zip
Infrastructure for better logging, finally!
Right now all existing logs are logged at Info, but this will change. This should make it significantly easier to debug things wit log levels like Trace. I may at some point define more log level endpoints or come up with a more expressive logging system, but this is a good start.
Diffstat (limited to 'src/Rahm/Desktop/Keys')
-rw-r--r--src/Rahm/Desktop/Keys/Wml.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Rahm/Desktop/Keys/Wml.hs b/src/Rahm/Desktop/Keys/Wml.hs
index 7659a7d..dd82922 100644
--- a/src/Rahm/Desktop/Keys/Wml.hs
+++ b/src/Rahm/Desktop/Keys/Wml.hs
@@ -107,12 +107,12 @@ alternateWorkspace :: Workspace
alternateWorkspace =
Workspace {
moveLocationToWorkspaceFn = \l@(Location _ maybeWin) -> do
- logs $ "Moving Location: " ++ show l
+ logs Info "Moving Location: %s" (show l)
case maybeWin of
Nothing -> return ()
Just win -> do
alter <- getAlternateWorkspace win
- logs $ printf "Moving %s to %s" (show win) (show alter)
+ logs Info "Moving %s to %s" (show win) (show alter)
mapM_ (moveLocationToWorkspace l) alter
, gotoWorkspaceFn = do
@@ -297,7 +297,7 @@ readNextLocationSet =
mapM windowLocation =<< MaybeT askWindowId
(_, _, "%") -> fromMaybeTX $ do
ret <- mapM windowLocation =<< lift (withWindowSet (return . sortOn Down . W.allWindows))
- lift $ logs $ "allWindows " ++ intercalate "\n" (map show ret)
+ lift $ logs Info "allWindows %s" (intercalate "\n" (map show ret))
return ret
(_, _, s) | s == "\t" || s == "@" || s == "\n" ->
(mt . windowsInWorkspace . workspaceName) =<< readNextWorkspace
@@ -329,7 +329,7 @@ readNextLocationSet =
return $ filter (`elem` l2) l1
(mask, keysym, _) -> do
macro <- (MaybeT . fromX) (Map.lookup (mask, keysym) . windowsetMacros <$> XS.get)
- lift $ fromX $ logs $ "Executing Macro: " ++ show macro
+ lift $ fromX $ logs Info "Executing Macro: %s" (show macro)
fromMaybeTX $ locationSetForKeysT macro
where
mt :: (KeyFeeder m) => X a -> MaybeT m a