use fastDebug everywhere it can be used

None of these are likely to yeild a noticable speedup though.
This commit is contained in:
Joey Hess 2021-04-06 15:41:24 -04:00
parent d16d739ce2
commit 13c090b37a
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
16 changed files with 17 additions and 28 deletions

View file

@ -8,6 +8,7 @@ import Key as X
import Types.UUID as X
import Annex as X (gitRepo, inRepo, fromRepo, calcRepo)
import Annex.Locations as X
import Annex.Debug as X (fastDebug, debug)
import Messages as X
#ifndef mingw32_HOST_OS
import System.Posix.IO as X hiding (createPipe)

View file

@ -22,7 +22,6 @@ import Annex.Content
import Annex.SpecialRemote.Config
import qualified Database.Keys
import Git.FilePath
import Utility.Debug
import qualified Data.Set as S
@ -117,7 +116,7 @@ handleDropsFrom locs rs reason fromhere key afile si preverified runner = do
dodrop n@(have, numcopies, mincopies, _untrusted) u a =
ifM (safely $ runner $ a numcopies mincopies)
( do
liftIO $ debug "Annex.Drop" $ unwords
fastDebug "Annex.Drop" $ unwords
[ "dropped"
, case afile of
AssociatedFile Nothing -> serializeKey key

View file

@ -13,7 +13,6 @@ import qualified Annex
import Annex.Common
import Git.Env
import Utility.Shell
import Utility.Debug
import Messages.Progress
import Control.Concurrent.Async

View file

@ -24,7 +24,6 @@ import Annex.Path
import Annex.StallDetection
import Utility.Batch
import Utility.Metered
import Utility.Debug
import qualified Utility.SimpleProtocol as Proto
import Control.Concurrent

View file

@ -7,7 +7,7 @@
module Assistant.Common (module X) where
import Annex.Common as X
import Annex.Common as X hiding (debug)
import Assistant.Monad as X
import Assistant.Types.DaemonStatus as X
import Assistant.Types.NamedThread as X

View file

@ -27,7 +27,7 @@ module Assistant.Monad (
import "mtl" Control.Monad.Reader
import qualified Control.Monad.Fail as Fail
import Annex.Common
import Annex.Common hiding (debug)
import Assistant.Types.ThreadedMonad
import Assistant.Types.DaemonStatus
import Assistant.Types.ScanRemotes

View file

@ -17,7 +17,6 @@ import Types.Key
import Types.Backend
import Types.KeySource
import Utility.Metered
import Utility.Debug
import qualified Utility.SimpleProtocol as Proto
import qualified Data.ByteString as S
@ -142,7 +141,7 @@ handleRequest st req whenunavail responsehandler =
warning ("external special remote error: " ++ err)
whenunavail
handleExceptionalMessage loop (DEBUG msg) = do
liftIO $ debug "Backend.External" msg
fastDebug "Backend.External" msg
loop
withExternalAddon :: ExternalState -> a -> (ExternalAddonProcess -> a) -> a

View file

@ -20,7 +20,6 @@ import Annex.NumCopies
import Annex.Content
import Annex.Wanted
import Annex.Notification
import Utility.Debug
import qualified Data.Set as S
@ -115,7 +114,7 @@ performLocal key afile numcopies mincopies preverified = lockContentForRemoval k
(tocheck, verified) <- verifiableCopies key [u]
doDrop u (Just contentlock) key afile numcopies mincopies [] (preverified ++ verified) tocheck
( \proof -> do
liftIO $ debug "Command.Drop" $ unwords
fastDebug "Command.Drop" $ unwords
[ "Dropping from here"
, "proof:"
, show proof
@ -142,7 +141,7 @@ performRemote key afile numcopies mincopies remote = do
(tocheck, verified) <- verifiableCopies key [uuid]
doDrop uuid Nothing key afile numcopies mincopies [uuid] verified tocheck
( \proof -> do
liftIO $ debug "Command.Drop" $ unwords
fastDebug "Command.Drop" $ unwords
[ "Dropping from remote"
, show remote
, "proof:"

View file

@ -49,7 +49,6 @@ import qualified Git.Ref
import qualified Annex.Branch
import Logs
import Git.CatFile (catObjectStream)
import Utility.Debug
cmd :: Command
cmd = notBareRepo $
@ -96,7 +95,7 @@ getFeed addunlockedmatcher opts cache url = do
)
where
debugfeedcontent feedcontent msg = do
liftIO $ debug "Command.ImportFeed" $ unlines
fastDebug "Command.ImportFeed" $ unlines
[ "start of feed content"
, feedcontent
, "end of feed content"

View file

@ -20,7 +20,6 @@ import Logs.Presence
import Logs.Trust
import Logs.File
import Annex.NumCopies
import Utility.Debug
import qualified Data.ByteString.Char8 as B8
import qualified Data.ByteString.Lazy as L
@ -177,7 +176,7 @@ toPerform dest removewhen key afile fastcheck isthere = do
DropWorse -> faileddrophere setpresentremote
showproof proof = "proof: " ++ show proof
drophere setpresentremote contentlock reason = do
liftIO $ debug "Command.Move" $ unwords
fastDebug "Command.Move" $ unwords
[ "Dropping from here"
, "(" ++ reason ++ ")"
]
@ -257,7 +256,7 @@ fromPerform src removewhen key afile = do
showproof proof = "proof: " ++ show proof
dropremote reason = do
liftIO $ debug "Command.Move" $ unwords
fastDebug "Command.Move" $ unwords
[ "Dropping from remote"
, show src
, "(" ++ reason ++ ")"

View file

@ -16,7 +16,6 @@ import Utility.Rsync
import Annex.Transfer
import qualified CmdLine.GitAnnexShell.Fields as Fields
import Utility.Metered
import Utility.Debug
cmd :: Command
cmd = noCommit $
@ -46,14 +45,14 @@ start (_, key) = do
fieldTransfer :: Direction -> Key -> (MeterUpdate -> Annex Bool) -> CommandStart
fieldTransfer direction key a = do
liftIO $ debug "Command.SendKey" "transfer start"
fastDebug "Command.SendKey" "transfer start"
afile <- AssociatedFile . (fmap toRawFilePath)
<$> Fields.getField Fields.associatedFile
ok <- maybe (a $ const noop)
-- Using noRetry here because we're the sender.
(\u -> runner (Transfer direction (toUUID u) (fromKey id key)) afile Nothing noRetry a)
=<< Fields.getField Fields.remoteUUID
liftIO $ debug "Command.SendKey" "transfer done"
fastDebug "Command.SendKey" "transfer done"
liftIO $ exitBool ok
where
{- Allow the key to be sent to the remote even if there seems to be

View file

@ -38,7 +38,6 @@ import Annex.Content
import Annex.Url
import Annex.UUID
import Creds
import Utility.Debug
import Control.Concurrent.STM
import qualified Data.Map as M
@ -494,7 +493,7 @@ handleRequest' st external req mp responsehandler
handleRemoteRequest (GETURLS key prefix) = do
mapM_ (send . VALUE) =<< getUrlsWithPrefix key prefix
send (VALUE "") -- end of list
handleRemoteRequest (DEBUG msg) = liftIO $ debug "Remote.External" msg
handleRemoteRequest (DEBUG msg) = fastDebug "Remote.External" msg
handleRemoteRequest (INFO msg) = showInfo msg
handleRemoteRequest (VERSION _) = senderror "too late to send VERSION"

View file

@ -39,7 +39,6 @@ import Backend.Hash
import Utility.Hash
import Utility.SshHost
import Utility.Url
import Utility.Debug
import Logs.Remote
import Logs.RemoteState
import qualified Git.Config
@ -349,11 +348,11 @@ makeSmallAPIRequest :: Request -> Annex (Response L.ByteString)
makeSmallAPIRequest req = do
uo <- getUrlOptions
let req' = applyRequest uo req
liftIO $ debug "Remote.GitLFS" (show req')
fastDebug "Remote.GitLFS" (show req')
resp <- liftIO $ httpLbs req' (httpManager uo)
-- Only debug the http status code, not the json
-- which may include an authentication token.
liftIO $ debug "Remote.GitLFS" (show $ responseStatus resp)
fastDebug "Remote.GitLFS" (show $ responseStatus resp)
return resp
sendTransferRequest

View file

@ -59,8 +59,8 @@ git_annex_shell cs r command params fields
dir = Git.repoPath r
shellcmd = "git-annex-shell"
getshellopts = do
debug <- annexDebug <$> Annex.getGitConfig
let params' = if debug
debugenabled <- annexDebug <$> Annex.getGitConfig
let params' = if debugenabled
then Param "--debug" : params
else params
return (Param command : File (fromRawFilePath dir) : params')

View file

@ -66,7 +66,6 @@ import qualified Annex.Url as Url
import Utility.Url (extractFromResourceT)
import Annex.Url (getUrlOptions, withUrlOptions, UrlOptions(..))
import Utility.Env
import Utility.Debug
type BucketName = String
type BucketObject = String

View file

@ -43,7 +43,6 @@ import Utility.Url (URLString, matchStatusCodeException, matchHttpExceptionConte
import Annex.UUID
import Remote.WebDAV.DavLocation
import Types.ProposedAccepted
import Utility.Debug
remote :: RemoteType
remote = specialRemoteType $ RemoteType