From 15016cf33058d0ce2a779d200af6d7bd56c506f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Er=C3=A8be?= Date: Wed, 1 Jun 2016 22:31:34 +0200 Subject: [PATCH] Add utils files --- src/Utils.hs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/Utils.hs 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