on master help sign in
send log over the wire if in ideslave mode

doesn't capture the Debug.Trace usage in Core (with log level >= 5) yet, unfortunately

commit9c9b38bf5f0bc49fd08d450711a532e1c1dbc6b9 authorHannes Mehnert <hannes@mehnert.org> dateWed 20 Nov 2013, 15:31 (13 years ago) parent0ef9d12
2 files changed+7−5
src/Idris/AbsSyntax.hs+6−3 src/Idris/AbsSyntaxTree.hs+1−2
src/Idris/AbsSyntax.hs+6−3
@@ -577,9 +577,12 @@ setColour ct c = do i <- getIState
577577logLvl :: Int -> String -> Idris ()
578578logLvl l str = do i <- getIState
579579 let lvl = opt_logLevel (idris_options i)
580− when (lvl >= l)
581− $ do runIO (putStrLn str)
582− putIState $ i { idris_log = idris_log i ++ str ++ "\n" }
580+ when (lvl >= l) $
581+ case idris_outputmode i of
582+ RawOutput -> do runIO $ putStrLn str
583+ IdeSlave n ->
584+ do let good = SexpList [IntegerAtom (toInteger l), toSExp str]
585+ runIO $ putStrLn $ convSExp "log" good n
583586
584587cmdOptType :: Opt -> Idris Bool
585588cmdOptType x = do i <- getIState
src/Idris/AbsSyntaxTree.hs+1−2
@@ -97,7 +97,6 @@ data IState = IState {
9797 idris_calledgraph :: Ctxt [Name],
9898 idris_docstrings :: Ctxt String,
9999 idris_totcheck :: [(FC, Name)],
100− idris_log :: String,
101100 idris_options :: IOption,
102101 idris_name :: Int,
103102 idris_lineapps :: [((FilePath, Int), PTerm)],
@@ -185,7 +184,7 @@ data IBCWrite = IBCFix FixDecl
185184idrisInit = IState initContext [] [] emptyContext emptyContext emptyContext
186185 emptyContext emptyContext emptyContext emptyContext
187186 emptyContext emptyContext emptyContext emptyContext
188− [] "" defaultOpts 6 [] [] [] [] [] [] [] [] [] [] [] []
187+ [] defaultOpts 6 [] [] [] [] [] [] [] [] [] [] [] []
189188 [] Nothing Nothing [] [] [] Hidden False [] Nothing [] [] RawOutput
190189 True defaultTheme stdout
191190