diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2019-02-02 22:13:57 +0000 |
---|---|---|
committer | Yann Herklotz <ymherklotz@gmail.com> | 2019-02-02 22:13:57 +0000 |
commit | 94082601ca31c079065c494cc24020471e0d3e31 (patch) | |
tree | 2333eb05bb616827e3f7792a94e71dba0296d119 /src/VeriFuzz/General.hs | |
parent | 686bc953c50cf23b96dba4f182e8005289e71b98 (diff) | |
download | verismith-94082601ca31c079065c494cc24020471e0d3e31.tar.gz verismith-94082601ca31c079065c494cc24020471e0d3e31.zip |
Try to add logging
Diffstat (limited to 'src/VeriFuzz/General.hs')
-rw-r--r-- | src/VeriFuzz/General.hs | 10 |
1 files changed, 8 insertions, 2 deletions
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 |