Files
simplexmq/apps/smp-agent/Main.hs
T
Evgeny Poberezkin d82c286a54 Logging (#24)
* logging with simple-logger

* refactor Agent.Client

* move logging to Agent.Client

* clean up

* log command name only
2021-02-26 18:11:22 +04:00

29 lines
665 B
Haskell

{-# LANGUAGE DuplicateRecordFields #-}
module Main where
import Control.Logger.Simple
import Simplex.Messaging.Agent (runSMPAgent)
import Simplex.Messaging.Agent.Env.SQLite
import Simplex.Messaging.Client (smpDefaultConfig)
cfg :: AgentConfig
cfg =
AgentConfig
{ tcpPort = "5224",
tbqSize = 16,
connIdBytes = 12,
dbFile = "smp-agent.db",
smpCfg = smpDefaultConfig
}
logCfg :: LogConfig
logCfg = LogConfig {lc_file = Nothing, lc_stderr = True}
main :: IO ()
main = do
putStrLn $ "SMP agent listening on port " ++ tcpPort (cfg :: AgentConfig)
setLogLevel LogInfo -- LogError
withGlobalLogging logCfg $
runSMPAgent cfg