diff --git a/src/Utils.hs b/src/Utils.hs new file mode 100644 index 0000000..1691050 --- /dev/null +++ b/src/Utils.hs @@ -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