From 94082601ca31c079065c494cc24020471e0d3e31 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Sat, 2 Feb 2019 22:13:57 +0000 Subject: Try to add logging --- src/VeriFuzz/General.hs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/VeriFuzz/General.hs') diff --git a/src/VeriFuzz/General.hs b/src/VeriFuzz/General.hs index 1d2f183..37a8f90 100644 --- a/src/VeriFuzz/General.hs +++ b/src/VeriFuzz/General.hs @@ -46,11 +46,11 @@ rootPath = do maybe current fromText <$> get_env "VERIFUZZ_ROOT" timeout :: FilePath -> [Text] -> Sh Text -timeout = command1 "timeout" ["180"] . toTextIgnore +timeout = command1 "timeout" ["500"] . toTextIgnore {-# INLINE timeout #-} timeout_ :: FilePath -> [Text] -> Sh () -timeout_ = command1_ "timeout" ["180"] . toTextIgnore +timeout_ = command1_ "timeout" ["500"] . toTextIgnore {-# INLINE timeout_ #-} -- | Helper function to convert bytestrings to integers @@ -68,3 +68,9 @@ echoP t = do echo $ bname fn <> " :: " <> t where bname = T.pack . takeBaseName . T.unpack . toTextIgnore + +logger :: FilePath -> Text -> Sh a -> Sh a +logger fp name = + log_stderr_with (l "_log.stderr.txt") . log_stdout_with (l "_log.txt") + where + l s = writeFile (T.unpack (toTextIgnore $ fp fromText name) <> s) . T.unpack -- cgit