Add utils files
This commit is contained in:
parent
9f668ca95a
commit
15016cf330
1 changed files with 20 additions and 0 deletions
20
src/Utils.hs
Normal file
20
src/Utils.hs
Normal 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
|
Loading…
Reference in a new issue