From 08017366b5e382c03c397906a7718d4365afc0b1 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Fri, 11 Jul 2025 13:48:58 -0700 Subject: [PATCH] imp: file reading: demote some debug=6 output to level 7 --- hledger-lib/Hledger/Data/Journal.hs | 4 ++-- hledger-lib/Hledger/Read/JournalReader.hs | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hledger-lib/Hledger/Data/Journal.hs b/hledger-lib/Hledger/Data/Journal.hs index 2d05de113..14732acef 100644 --- a/hledger-lib/Hledger/Data/Journal.hs +++ b/hledger-lib/Hledger/Data/Journal.hs @@ -308,10 +308,10 @@ journalRenumberAccountDeclarations j = j{jdeclaredaccounts=jdas'} -- it seems unneeded except perhaps for debugging -- | Debug log the ordering of a journal's account declarations --- (at debug level 5+). +-- (at debug level 7+). dbgJournalAcctDeclOrder :: String -> Journal -> Journal dbgJournalAcctDeclOrder prefix = - dbg5With ((prefix++) . showAcctDeclsSummary . jdeclaredaccounts) + dbg7With ((prefix++) . showAcctDeclsSummary . jdeclaredaccounts) where showAcctDeclsSummary :: [(AccountName,AccountDeclarationInfo)] -> String showAcctDeclsSummary adis diff --git a/hledger-lib/Hledger/Read/JournalReader.hs b/hledger-lib/Hledger/Read/JournalReader.hs index 78b526d13..725c7b1fb 100644 --- a/hledger-lib/Hledger/Read/JournalReader.hs +++ b/hledger-lib/Hledger/Read/JournalReader.hs @@ -300,7 +300,7 @@ includedirectivep = do lift followingcommentp -- find file(s) let (mprefix,glb) = splitReaderPrefix prefixedglob - when (null $ dbg7 "glob pattern" glb) $ + when (null $ dbg6 "include: glob pattern" glb) $ customFailure $ parseErrorAt off $ "include needs a file path or glob pattern argument" paths <- getFilePaths2 off pos glb let prefixedpaths = case mprefix of @@ -328,7 +328,7 @@ includedirectivep = do realparentfilepath <- liftIO $ canonicalizePath parentfilepath -- Follow a symlink. If the path is already absolute, the operation never fails. let curdir = takeDirectory realparentfilepath -- Find all matched files, in lexicographic order (the order ls would normally show them) - filepaths <- liftIO $ (dbg7 "include: matched files" . sort) <$> globDir1 fileglob curdir + filepaths <- liftIO $ (dbg6 "include: matched files" . sort) <$> globDir1 fileglob curdir if (not . null) filepaths then pure filepaths else customFailure $ parseErrorAt parseroff $ "No files were matched by file pattern: " ++ fileglobpattern @@ -350,7 +350,7 @@ includedirectivep = do -- find all matched files, in lexicographic order (the order ls would normally show them) filepaths <- liftIO $ - dbg7 "include: matched files" + dbg6 "include: matched files" . map (cwd ) -- . sort -- XXX needed ? <$> @@ -383,7 +383,7 @@ includedirectivep = do -- defaulting to JournalReader. Duplicating readJournal a bit here. let r = fromMaybe reader $ findReader Nothing (Just prefixedpath) parser = rParser r - dbg6IO "parseIncludedFile: trying reader" (rFormat r) + dbg7IO "parseIncludedFile: trying reader" (rFormat r) -- Parse the file (and its own includes, if any) to a Journal -- with file path and source text attached. Or throw an error. @@ -549,7 +549,7 @@ commoditydirectiveonelinep = do pure $ (off, amt) lift skipNonNewlineSpaces _ <- lift followingcommentp - let comm = Commodity{csymbol=acommodity, cformat=Just $ dbg6 "style from commodity directive" astyle} + let comm = Commodity{csymbol=acommodity, cformat=Just $ dbg7 "style from commodity directive" astyle} if isNothing $ asdecimalmark astyle then customFailure $ parseErrorAt off pleaseincludedecimalpoint else modify' (\j -> j{jdeclaredcommodities=M.insert acommodity comm $ jdeclaredcommodities j}) @@ -595,7 +595,7 @@ formatdirectivep expectedsym = do then if isNothing $ asdecimalmark astyle then customFailure $ parseErrorAt off pleaseincludedecimalpoint - else return $ dbg6 "style from format subdirective" astyle + else return $ dbg7 "style from format subdirective" astyle else customFailure $ parseErrorAt off $ printf "commodity directive symbol \"%s\" and format directive symbol \"%s\" should be the same" expectedsym acommodity