;dev: cli: clarify that conf debug output goes to console

This commit is contained in:
Simon Michael 2024-07-12 13:27:55 +01:00
parent a059c9e8cc
commit e3c414fe59
2 changed files with 5 additions and 0 deletions

View File

@ -188,10 +188,13 @@ main = withGhcDebug' $ do
-- let's go!
let
-- Trace helpers. These always trace to stderr, even when running `hledger ui`;
-- that's ok as conf is a hledger cli feature for now.
dbgIO, dbgIO1, dbgIO2 :: Show a => String -> a -> IO () -- this signature is needed
dbgIO = ptraceAtIO verboseDebugLevel
dbgIO1 = ptraceAtIO 1
dbgIO2 = ptraceAtIO 2
dbgIO "running" prognameandversion
starttime <- getPOSIXTime

View File

@ -75,6 +75,8 @@ confLookup cmd Conf{confSections} =
-- Otherwise this returns the parsed Conf, and the file path.
getConf :: RawOpts -> IO (Conf, Maybe FilePath)
getConf rawopts
-- As in Cli.hs, conf debug output always goes to stderr;
-- that's ok as conf is a hledger cli feature for now.
| noconf = return $ traceAt 1 "ignoring config files" (nullconf, Nothing)
| otherwise = do
defconfpaths <- confFilePaths