From b073c6214dd62c9b8d30c5ec187375828c753d0e Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Tue, 7 May 2019 19:20:21 +0100 Subject: Create better command line output --- src/VeriFuzz/Sim/Internal.hs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/VeriFuzz/Sim') diff --git a/src/VeriFuzz/Sim/Internal.hs b/src/VeriFuzz/Sim/Internal.hs index 06d0264..c26b888 100644 --- a/src/VeriFuzz/Sim/Internal.hs +++ b/src/VeriFuzz/Sim/Internal.hs @@ -45,6 +45,7 @@ import qualified Data.ByteString as B import Data.Maybe (catMaybes) import Data.Text (Text) import qualified Data.Text as T +import Data.Time.Format (defaultTimeLocale, formatTime) import Data.Time.LocalTime (getZonedTime) import Prelude hiding (FilePath) import Shelly @@ -152,7 +153,13 @@ logger :: Text -> Sh () logger t = do fn <- pwd currentTime <- liftIO getZonedTime - echo $ bname fn <> " [" <> showT currentTime <> "] - " <> t + echo + $ "VeriFuzz [" + <> T.pack (formatTime defaultTimeLocale "%Y-%m-%d %H:%M:%S" currentTime) + <> "] " + <> bname fn + <> " - " + <> t where bname = T.pack . takeBaseName . T.unpack . toTextIgnore logCommand :: FilePath -> Text -> Sh a -> Sh a -- cgit