imp: ui: debug log startup args, debug level, initial screen stack
This commit is contained in:
parent
da569e51e1
commit
1a526b82c9
@ -1,5 +1,3 @@
|
|||||||
-- TODO: brick 1 support
|
|
||||||
-- https://hackage.haskell.org/package/brick-1.0/changelog
|
|
||||||
{-|
|
{-|
|
||||||
hledger-ui - a hledger add-on providing a curses-style interface.
|
hledger-ui - a hledger add-on providing a curses-style interface.
|
||||||
Copyright (c) 2007-2015 Simon Michael <simon@joyful.com>
|
Copyright (c) 2007-2015 Simon Michael <simon@joyful.com>
|
||||||
@ -37,7 +35,7 @@ import Hledger.UI.Theme
|
|||||||
import Hledger.UI.UIOptions
|
import Hledger.UI.UIOptions
|
||||||
import Hledger.UI.UITypes
|
import Hledger.UI.UITypes
|
||||||
import Hledger.UI.UIState (uiState, getDepth)
|
import Hledger.UI.UIState (uiState, getDepth)
|
||||||
import Hledger.UI.UIUtils (dbguiEv)
|
import Hledger.UI.UIUtils (dbguiEv, showScreenStack, showScreenSelection)
|
||||||
import Hledger.UI.MenuScreen
|
import Hledger.UI.MenuScreen
|
||||||
import Hledger.UI.AccountsScreen
|
import Hledger.UI.AccountsScreen
|
||||||
import Hledger.UI.BalancesheetScreen
|
import Hledger.UI.BalancesheetScreen
|
||||||
@ -58,6 +56,10 @@ writeChan = BC.writeBChan
|
|||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = withProgName "hledger-ui.log" $ do -- force Hledger.Utils.Debug.* to log to hledger-ui.log
|
main = withProgName "hledger-ui.log" $ do -- force Hledger.Utils.Debug.* to log to hledger-ui.log
|
||||||
|
traceLogAtIO 1 "\n\n\n\n==== hledger-ui start"
|
||||||
|
dbg1IO "args" progArgs
|
||||||
|
dbg1IO "debugLevel" debugLevel
|
||||||
|
|
||||||
opts@UIOpts{uoCliOpts=copts@CliOpts{inputopts_=iopts,rawopts_=rawopts}} <- getHledgerUIOpts
|
opts@UIOpts{uoCliOpts=copts@CliOpts{inputopts_=iopts,rawopts_=rawopts}} <- getHledgerUIOpts
|
||||||
-- when (debug_ $ cliopts_ opts) $ printf "%s\n" prognameandversion >> printf "opts: %s\n" (show opts)
|
-- when (debug_ $ cliopts_ opts) $ printf "%s\n" prognameandversion >> printf "opts: %s\n" (show opts)
|
||||||
|
|
||||||
@ -142,7 +144,9 @@ runBrickUi uopts0@UIOpts{uoCliOpts=copts@CliOpts{inputopts_=_iopts,reportspec_=r
|
|||||||
-- if an account query has been provided at startup.
|
-- if an account query has been provided at startup.
|
||||||
-- Whichever it is, we also set up a stack of previous screens,
|
-- Whichever it is, we also set up a stack of previous screens,
|
||||||
-- as if you had navigated down to it from the top.
|
-- as if you had navigated down to it from the top.
|
||||||
(prevscrs, currscr) = case (uoRegister uopts, hasbsaccts, hasacctquery) of
|
(prevscrs, currscr) =
|
||||||
|
dbg1With (showScreenStack "initial" showScreenSelection . uncurry2 (uiState defuiopts nulljournal)) $
|
||||||
|
case (uoRegister uopts, hasbsaccts, hasacctquery) of
|
||||||
|
|
||||||
-- With --register=ACCT, the initial screen stack is:
|
-- With --register=ACCT, the initial screen stack is:
|
||||||
-- 1. menu screen, with ACCTSSCR selected
|
-- 1. menu screen, with ACCTSSCR selected
|
||||||
@ -210,8 +214,6 @@ runBrickUi uopts0@UIOpts{uoCliOpts=copts@CliOpts{inputopts_=_iopts,reportspec_=r
|
|||||||
setMode (outputIface v) Mouse True
|
setMode (outputIface v) Mouse True
|
||||||
return v
|
return v
|
||||||
|
|
||||||
traceLogAtIO 1 "\n\n==== hledger-ui start"
|
|
||||||
|
|
||||||
if not (uoWatch uopts)
|
if not (uoWatch uopts)
|
||||||
then do
|
then do
|
||||||
vty <- makevty
|
vty <- makevty
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user