Add utils files

This commit is contained in:
Erèbe 2016-06-01 22:31:34 +02:00
parent 9f668ca95a
commit 15016cf330

20
src/Utils.hs Normal file
View file

@ -0,0 +1,20 @@
{-# LANGUAGE NoImplicitPrelude #-}
module Utils where
import ClassyPrelude
import Network.Socket (HostName, PortNumber)
import qualified System.Log.Logger as LOG
toStr :: (HostName, PortNumber) -> String
toStr (host, port) = fromString host <> ":" <> show port
err :: String -> IO()
err msg = LOG.errorM "wstunnel" $ "ERROR :: " <> msg
info :: String -> IO()
info = LOG.infoM "wstunnel"
debug :: String -> IO()
debug msg = LOG.debugM "wstunnel" $ "DEBUG :: " <> msg