Skip to content

Instantly share code, notes, and snippets.

@tsloughter
Created April 13, 2014 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsloughter/10586031 to your computer and use it in GitHub Desktop.
Save tsloughter/10586031 to your computer and use it in GitHub Desktop.
(<=>) :: (Show a) => B.ByteString -> a -> (B.ByteString, B.ByteString)
(<=>) x y = (x, showBS y)
infoLog :: (MonadSnap m) => [(B.ByteString, B.ByteString)] -> m()
infoLog l = logError $ B.append ("[INFO] ") $
B.intercalate " " $ map (\(x,y) -> B.concat [x, "=", y]) l
showBS :: (Show a) => a -> B.ByteString
showBS = B.pack . show
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment