[BUGFIX: need to adapt instance Monoid Log on changed implementation
martin.hofmann@uni-bamberg.de**20090629021215] hunk ./src/Data/GlobalConfig.hs 20
+    , scr_dumpLog    :: Bool
hunk ./src/Data/GlobalConfig.hs 31
-defaultSCR = SCR False False False NOTICE (-1) Linear [] []
+defaultSCR = SCR False False False False NOTICE (-1) Linear [] []
hunk ./src/Data/GlobalConfig.hs 40
+                fill 20 (text "dumpLog") <+> bool (scr_dumpLog c) <$>                
hunk ./src/Logging/Logger.hs 7
-    LM, ELT,
+    LM, ELT, mkLogState,
hunk ./src/Logging/Logger.hs 29
+import Data.Function (on)
hunk ./src/Logging/Logger.hs 71
-mergeEntries :: LogEntry -> LogEntry -> [LogEntry]
-mergeEntries (LE p1 l1 m1) (LE p2 l2 m2)
-    | p1 == p2 && l1 == l2 = [LE p1 l1 (m1 <$$> m2)]
-    | otherwise            = [(LE p1 l1 m1),(LE p2 l2 m2)]
-    
+--mergeEntries :: LogEntry -> LogEntry -> [LogEntry]
+--mergeEntries (LE p1 l1) (LE p2 l2)
+--    | p1 == p2 && l1 == l2 = [LE p1 l1 (m1 <$$> m2)]
+--    | otherwise            = [(LE p1 l1 m1),(LE p2 l2 m2)]
+--    
hunk ./src/Logging/Logger.hs 80
-                   ,debugging  :: Bool}    -- ^Debug
-
-mkLogState v b = LS v "" "" b
+                   ,debugging  :: Bool     -- ^Debug
+                   ,dumpLog  :: Bool}    -- ^Debug
hunk ./src/Logging/Logger.hs 83
-data Log = Log  {logs :: ![LogEntry], lst :: Maybe LogEntry}
-     deriving (Show)
-emptyLog = Log [] Nothing
+mkLogState v d l = LS v "" "" d l
hunk ./src/Logging/Logger.hs 85
-instance Pretty Log where
-    pretty l = (prettyList (logs l)) <$$> (prettyList (maybeToList (lst l)))
+newtype Log = Log {unLog :: [LogEntry]}
+    deriving(Show)
+emptyLog = Log []
hunk ./src/Logging/Logger.hs 90
-    mempty  = Log [] Nothing
-    mappend (Log _ Nothing) l2  = l2
-    mappend l1 (Log _ Nothing)  = l1
-    mappend (Log logs1 (Just l)) (Log logs2 (Just l2)) =
-        let (x:xs)  = logs2 ++ [l2]
-            mes     = mergeEntries l x
-            logs    = mes ++ xs
-            newlst  = last logs
-            newlogs = logs1 ++ (init logs)
-        in Log newlogs (Just newlst)
-
+    mempty  = emptyLog
+    mappend = ((Log . ) . (flip (++))) `on` unLog
hunk ./src/Logging/Logger.hs 93
+instance Pretty Log where
+    pretty = pretty . unLog
+       
hunk ./src/Logging/Logger.hs 168
+isDumping :: (MonadState LogState m, MonadWriter Log m) =>m Bool
+isDumping = gets dumpLog
+
+setDumping ::  (MonadState LogState m, MonadWriter Log m) =>Bool -> m ()
+setDumping d = modify (\l -> l{dumpLog = d})
+
hunk ./src/Logging/Logger.hs 186
-       if ((isPrefixOf gll l) && (p <= lvl))
-        then tell (Log [] (Just (LE p l msg))) >> 
-             isDebugging >>= traceIfDebug msg                  
-        else return() 
-    where
-    traceIfDebug msg b = when b (lift3 . putStrLn . show $ msg)
+       when ((isPrefixOf gll l) && (p <= lvl)) (do
+            isDebugging >>= flip when (lift3 . putStrLn . show $ msg)
+            --isDumping >>= flip when (lift3 . (appendFile "dump.txt") . show $ msg)
+            isDumping >>= flip when ( tell $ Log [LE p l msg])
+            return ()
+            )
+       return() 
hunk ./src/Logging/Logger.hs 198
-runELT :: (Monad m) => Priority -> Bool -> (ELT m a) -> m (Either String a, Log) 
-runELT v b m =  runWriterT (runErrorT (evalStateT m (mkLogState v b)))
+runELT :: (Monad m) => (ELT m a) -> LogState -> m (Either String a, Log) 
+runELT m s =  runWriterT (runErrorT (evalStateT m s))
hunk ./src/Logging/Logger.hs 202
-runLM :: (Monad m) =>
-          Priority -> Bool -> ELT m a -> m (Either String a, Log)
+runLM :: ELT IO a -> LogState -> IO (Either String a, Log)
hunk ./src/SynthesisEngine.hs 37
-    (runLM (scr_verbosity conf) (scr_debug conf) (synthesise conf tgt bgk))
-        `catchError` \m -> return (Left (show m), emptyLog)
+    (runLM (synthesise conf tgt bgk) logstate)
+         `catchError` \m -> return (Left (show m), emptyLog)
+    where
+    logstate = mkLogState (scr_verbosity conf) (scr_debug conf) (scr_dumpLog conf)
hunk ./src/SynthesisEngine.hs 77
+    hypoCount >>= \c -> llogNO $ text "#Hypos:" <+> pretty c
hunk ./src/SynthesisEngine.hs 82
-       
+
hunk ./src/SynthesisEngine.hs 137
-    hypoCount >>= \c -> llogNO $ text "#Hypos:" <+> pretty c
hunk ./src/UI/UIStarter.hs 261
-    newConfig = SCR (debug s) (simplify s)(enhanced s)(verbosity s)(maxLoops s) (cmpRecArg s) tgts bgks
+    newConfig = SCR (debug s) (simplify s)(enhanced s)(dumpLog s)(verbosity s)(maxLoops s) (cmpRecArg s) tgts bgks