summaryrefslogtreecommitdiff
path: root/Messages.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2015-08-13 15:05:39 -0400
committerJoey Hess <joeyh@joeyh.name>2015-08-13 15:05:39 -0400
commit43aa881b47b3362f7f5cda3a5301177784fcfe47 (patch)
treee2f4c994512b94048c274222afd187d07a37f6c9 /Messages.hs
parent34c848381f6287eb22c81d02c6f08e6fe96745ca (diff)
--debug is passed along to git-annex-shell when git-annex is in debug mode.
Diffstat (limited to 'Messages.hs')
-rw-r--r--Messages.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Messages.hs b/Messages.hs
index c6d033402d..026fca51e6 100644
--- a/Messages.hs
+++ b/Messages.hs
@@ -32,6 +32,7 @@ module Messages (
setupConsole,
enableDebugOutput,
disableDebugOutput,
+ debugEnabled,
commandProgressDisabled,
) where
@@ -191,6 +192,12 @@ enableDebugOutput = updateGlobalLogger rootLoggerName $ setLevel DEBUG
disableDebugOutput :: IO ()
disableDebugOutput = updateGlobalLogger rootLoggerName $ setLevel NOTICE
+{- Checks if debugging is enabled. -}
+debugEnabled :: IO Bool
+debugEnabled = do
+ l <- getRootLogger
+ return $ getLevel l <= Just DEBUG
+
{- Should commands that normally output progress messages have that
- output disabled? -}
commandProgressDisabled :: Annex Bool