switch from hslogger to purpose-built Utility.Debug
This uses a DebugSelector, rather than debug levels, which will allow for a later option like --debug-from=Process to only see debuging about running processes. The module name that contains the thing being debugged is used as the DebugSelector (in most cases; does not need to be a hard and fast rule). Debug calls were changed to add that. hslogger did not display that first parameter to debugM, but the DebugSelector does get displayed. Also fastDebug will allow doing debugging in places that are used in tight loops, with the DebugSelector coming from the Annex Reader essentially for free. Not done yet.
This commit is contained in:
parent
19c672e710
commit
aaba83795b
26 changed files with 194 additions and 105 deletions
|
@ -6,6 +6,7 @@
|
|||
-}
|
||||
|
||||
{-# LANGUAGE ScopedTypeVariables #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
module Remote.WebDAV (remote, davCreds, configUrl) where
|
||||
|
||||
|
@ -21,7 +22,6 @@ import Network.HTTP.Types
|
|||
import System.IO.Error
|
||||
import Control.Monad.Catch
|
||||
import Control.Monad.IO.Class (MonadIO)
|
||||
import System.Log.Logger (debugM)
|
||||
import Control.Concurrent.STM hiding (check)
|
||||
|
||||
import Annex.Common
|
||||
|
@ -43,6 +43,7 @@ import Utility.Url (URLString, matchStatusCodeException, matchHttpExceptionConte
|
|||
import Annex.UUID
|
||||
import Remote.WebDAV.DavLocation
|
||||
import Types.ProposedAccepted
|
||||
import Utility.Debug
|
||||
|
||||
remote :: RemoteType
|
||||
remote = specialRemoteType $ RemoteType
|
||||
|
@ -533,4 +534,4 @@ withStoredFilesLegacyChunked k dav onerr a = do
|
|||
keyloc = keyLocation k
|
||||
|
||||
debugDav :: MonadIO m => String -> DAVT m ()
|
||||
debugDav msg = liftIO $ debugM "WebDAV" msg
|
||||
debugDav msg = liftIO $ debug "Remote.WebDAV" msg
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue