summaryrefslogtreecommitdiff
path: root/Messages.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-06-17 20:41:17 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-06-17 20:41:27 -0400
commitfa8116c070eb695f27e56a1e6384b8ef59bb40d8 (patch)
tree7338a60fc2e6c6e7d22c696006a4bf9cce1b1a7e /Messages.hs
parent4dfa412c10bf5811858da509cef8558c8bcc0be3 (diff)
annex.debug can now be set to enable debug logging by default. The webapp's debugging check box does this.
Diffstat (limited to 'Messages.hs')
-rw-r--r--Messages.hs10
1 files changed, 9 insertions, 1 deletions
diff --git a/Messages.hs b/Messages.hs
index b2fcba881..0357da12d 100644
--- a/Messages.hs
+++ b/Messages.hs
@@ -31,7 +31,9 @@ module Messages (
showCustom,
showHeader,
showRaw,
- setupConsole
+ setupConsole,
+ enableDebugOutput,
+ disableDebugOutput
) where
import Text.JSON
@@ -220,6 +222,12 @@ setupConsole = do
fileEncoding stdout
fileEncoding stderr
+enableDebugOutput :: IO ()
+enableDebugOutput = updateGlobalLogger rootLoggerName $ setLevel DEBUG
+
+disableDebugOutput :: IO ()
+disableDebugOutput = updateGlobalLogger rootLoggerName $ setLevel NOTICE
+
handle :: IO () -> IO () -> Annex ()
handle json normal = withOutputType go
where