fix fastDebug to check if debugging is actually enabled
Had to add to AnnexRead an indication of whether debugging is enabled. Could have just made setupConsole not install a debug output action that outputs, and have enableDebug be what installs that, but then in the common case where there is no debug selector, and so all debug output is selected, it would run the debug output action every time, which entails an IORef access. Which would make fastDebug too slow..
This commit is contained in:
parent
13c090b37a
commit
2e9d4ac754
5 changed files with 19 additions and 14 deletions
|
@ -142,14 +142,14 @@ subCmdName argv = (name, args)
|
|||
| otherwise = (Just a, reverse c ++ as)
|
||||
|
||||
-- | Note that the GlobalSetter must have already had its annexReadSetter
|
||||
-- applied before entering the Annex monad; that cannot be changed while
|
||||
-- running in the Annex monad.
|
||||
-- applied before entering the Annex monad to run this; that cannot be
|
||||
-- changed while running in the Annex monad.
|
||||
prepRunCommand :: Command -> GlobalSetter -> Annex ()
|
||||
prepRunCommand cmd globalsetter = do
|
||||
when (cmdnomessages cmd) $
|
||||
Annex.setOutput QuietOutput
|
||||
annexStateSetter globalsetter
|
||||
whenM (annexDebug <$> Annex.getGitConfig) $
|
||||
whenM (Annex.getRead Annex.debugenabled) $
|
||||
enableDebugOutput
|
||||
|
||||
findAddonCommand :: Maybe String -> IO (Maybe Command)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue