diff options
author | AndrewRademacher <andrew.rademacher@smrxt.com> | 2016-02-24 21:02:15 -0600 |
---|---|---|
committer | AndrewRademacher <andrew.rademacher@smrxt.com> | 2016-02-24 21:02:15 -0600 |
commit | c91dbdc0f5be0f1ec6a0cafc441eef0aa6da58d7 (patch) | |
tree | d6ebba7852d875b1ef2e6275f0c106941f842f1c /src/Graylog/UDP.hs | |
parent | 2ff46fce748b0e813f13f03c034065092145a28d (diff) | |
download | haskell-graylog-c91dbdc0f5be0f1ec6a0cafc441eef0aa6da58d7.tar.gz haskell-graylog-c91dbdc0f5be0f1ec6a0cafc441eef0aa6da58d7.tar.zst haskell-graylog-c91dbdc0f5be0f1ec6a0cafc441eef0aa6da58d7.zip |
Defined sendLog function.
Diffstat (limited to 'src/Graylog/UDP.hs')
-rw-r--r-- | src/Graylog/UDP.hs | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/Graylog/UDP.hs b/src/Graylog/UDP.hs index 00b6a12..dc172b9 100644 --- a/src/Graylog/UDP.hs +++ b/src/Graylog/UDP.hs | |||
@@ -1,13 +1,22 @@ | |||
1 | module Graylog.UDP | 1 | module Graylog.UDP |
2 | ( Graylog (..) | 2 | ( sendLog |
3 | , sendLog | ||
4 | 3 | ||
5 | , module Export | 4 | , module Export |
6 | ) where | 5 | ) where |
7 | 6 | ||
8 | import Graylog.Gelf as Export | 7 | import Data.Aeson |
9 | import Graylog.Types as Export | 8 | import qualified Data.ByteString.Lazy as LBS |
9 | import Network.Socket.ByteString.Lazy | ||
10 | import System.Random.MWC | ||
11 | |||
12 | import Graylog.Gelf as Export | ||
13 | import Graylog.Types as Export | ||
10 | 14 | ||
11 | sendLog :: Graylog -> GELF -> IO () | 15 | sendLog :: Graylog -> GELF -> IO () |
12 | sendLog glog msg = undefined | 16 | sendLog glog msg = mapM_ (send $ _graylogSocket glog) cks |
17 | where | ||
18 | raw = encode msg | ||
19 | cks = chunky raw | ||
13 | 20 | ||
21 | chunky :: LBS.ByteString -> [LBS.ByteString] | ||
22 | chunky = undefined | ||