1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 00:42:33 +03:00

Documentation

This commit is contained in:
Timothy Clem 2018-06-11 14:01:46 -07:00
parent ff47ad3653
commit 701e36fb19
3 changed files with 7 additions and 12 deletions

View File

@ -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 }

View File

@ -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

View File

@ -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 ()