annex.debug can now be set to enable debug logging by default. The webapp's debugging check box does this.

This commit is contained in:
Joey Hess 2013-06-17 20:41:17 -04:00
parent 9200e9a5f9
commit fa1c1e0f65
7 changed files with 33 additions and 7 deletions

View file

@ -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