From 17ebd0137f1430e955674f330819fb3b4b43401b Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Sun, 1 Jan 2023 18:06:48 -0500 Subject: [PATCH] ENH tweak logging --- bin/xmobar.hs | 5 +++++ lib/Data/Internal/Dependency.hs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/xmobar.hs b/bin/xmobar.hs index fe6f300..ac6292d 100644 --- a/bin/xmobar.hs +++ b/bin/xmobar.hs @@ -75,6 +75,11 @@ run :: XIO () run = do -- IDK why this is needed, I thought this was default liftIO $ hSetBuffering stdout LineBuffering + -- this isn't totally necessary except for the fact that killing xmobar + -- will make it print something about catching SIGTERM, and without + -- linebuffering it usually only prints the first few characters (even then + -- it only prints 10-20% of the time) + liftIO $ hSetBuffering stderr LineBuffering withDBus_ $ \db -> do c <- evalConfig db liftIO $ xmobar c diff --git a/lib/Data/Internal/Dependency.hs b/lib/Data/Internal/Dependency.hs index d90feea..68a60c4 100644 --- a/lib/Data/Internal/Dependency.hs +++ b/lib/Data/Internal/Dependency.hs @@ -130,7 +130,7 @@ import XMonad.Internal.Theme -- Currently there is no easy way to not use this (oh well) runXIO :: XIO a -> IO a runXIO x = do - logOpts <- logOptionsHandle stderr False + logOpts <- setLogVerboseFormat True . setLogUseTime True <$> logOptionsHandle stderr False pc <- mkDefaultProcessContext withLogFunc logOpts $ \f -> do p <- getParams