From 701e36fb1907a14c4e43b627c64f92b39cd87d32 Mon Sep 17 00:00:00 2001 From: Timothy Clem Date: Mon, 11 Jun 2018 14:01:46 -0700 Subject: [PATCH] Documentation --- src/Semantic/Config.hs | 12 ++++++------ src/Semantic/Haystack.hs | 3 --- src/Semantic/Log.hs | 4 +--- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/Semantic/Config.hs b/src/Semantic/Config.hs index fc68b9d22..52a302478 100644 --- a/src/Semantic/Config.hs +++ b/src/Semantic/Config.hs @@ -14,12 +14,12 @@ import System.Posix.Types data Config = Config - { configAppName :: String - , configHostName :: String -- ^ HostName - , configProcessID :: ProcessID -- ^ ProcessID - , configHaystackURL :: Maybe String - , configStatsAddr :: StatsAddr - , configLogOptions :: Options + { configAppName :: String -- ^ Application name (semantic) + , configHostName :: String -- ^ HostName from getHostName + , configProcessID :: ProcessID -- ^ ProcessID from getProcessID + , configHaystackURL :: Maybe String -- ^ URL of Haystack, with creds from environment + , configStatsAddr :: StatsAddr -- ^ Address of statsd/datadog + , configLogOptions :: Options -- ^ Options pertaining to logging } data StatsAddr = StatsAddr { addrHost :: String, addrPort :: String } diff --git a/src/Semantic/Haystack.hs b/src/Semantic/Haystack.hs index aca070497..a6c263115 100644 --- a/src/Semantic/Haystack.hs +++ b/src/Semantic/Haystack.hs @@ -47,9 +47,6 @@ haystackClient maybeURL managerSettings hostName appName | otherwise = pure NullHaystackClient -- Report an error to Haystack over HTTP (blocking). --- --- Returns Left error if reporting failed (or if using the NullHaystackClient) --- or Right status code received from sending the report. reportError :: MonadIO io => LogQueue -> HaystackClient -> ErrorReport -> io () reportError logger NullHaystackClient e = logError logger e reportError logger HaystackClient{..} e@ErrorReport{..} = do diff --git a/src/Semantic/Log.hs b/src/Semantic/Log.hs index f3161e161..81fae6269 100644 --- a/src/Semantic/Log.hs +++ b/src/Semantic/Log.hs @@ -14,9 +14,6 @@ import System.Posix.Process import System.Posix.Types import Text.Printf - -type LogQueue = AsyncQueue Message Options - -- | A log message at a specific level. data Message = Message Level String [(String, String)] LocalTime.ZonedTime deriving (Show) @@ -28,6 +25,7 @@ data Level | Debug deriving (Eq, Ord, Show) +type LogQueue = AsyncQueue Message Options -- | Queue a message to be logged. queueLogMessage :: MonadIO io => LogQueue -> Level -> String -> [(String, String)] -> io ()