~singpolyma/cheogram

de56b29f53bfb3f24ed271d53a67fcdfc4d75c73 — Stephen Paul Weber 8 years ago a94124d
Put time in logs
1 files changed, 3 insertions(+), 1 deletions(-)

M Main.hs
M Main.hs => Main.hs +3 -1
@@ 28,7 28,9 @@ instance Ord JID where
	compare x y = compare (show x) (show y)

log :: (Show a, MonadIO m) => String -> a -> m ()
log tag x = liftIO $ putStr (fromString $ tag <> " :: ") >> print x >> putStrLn mempty
log tag x = liftIO $ do
	time <- getCurrentTime
	putStr (fromString $ show time <> " " <> tag <> " :: ") >> print x >> putStrLn mempty

data StanzaRec = StanzaRec (Maybe JID) (Maybe JID) (Maybe Text) (Maybe Text) [Element] Element deriving (Show)
mkStanzaRec x = StanzaRec (stanzaTo x) (stanzaFrom x) (stanzaID x) (stanzaLang x) (stanzaPayloads x) (stanzaToElement x)