8 {-import Data.ByteString.Builder-}
9 {-import qualified Data.ByteString.Lazy as LBS-}
11 import Network.Socket.ByteString.Lazy
12 {-import System.Random-}
14 import Graylog.Gelf as Export
15 import Graylog.Types as Export
17 sendLog :: Graylog -> GELF -> IO ()
19 _ <- send (_graylogSocket glog) raw
25 {-sendLog :: Graylog -> GELF -> IO ()-}
26 {-sendLog glog msg = do-}
27 {-cks <- chunky glog raw-}
28 {-mapM_ (send $ _graylogSocket glog) cks-}
32 {-chunky :: Graylog -> LBS.ByteString -> IO [LBS.ByteString]-}
33 {-chunky glog raw = do-}
34 {-groupId <- randomIO-}
37 {-magic = word8 0x1e <> word8 0x0f-}
38 {-seqNum = undefined-}
39 {-(count, excess) = quotRem (LBS.length raw) gzie-}
41 {-gsize = (fromIntegral (_graylogChunkSize glog)) - hlen-}