on master help sign in
Fix: work with newer stm
22ee0e1Aleksey Uimanov
katip-datadog/src/Katip/Scribes/Datadog/TCP.hs+1−1
@@ -33,8 +33,8 @@ import qualified Data.Text.Lazy.Builder as B
33import Data.Time (NominalDiffTime)
33import Data.Time (NominalDiffTime)
34import Katip
34import Katip
35import Katip.Core (LocJs (..))
35import Katip.Core (LocJs (..))
36−import qualified Network as Net
37import qualified Network.Connection as C
36import qualified Network.Connection as C
37+import qualified Network.Socket as Net
38import qualified System.Posix.Types as POSIX
38import qualified System.Posix.Types as POSIX
39-------------------------------------------------------------------------------
39-------------------------------------------------------------------------------
40
40
katip/katip.cabal+3−2
@@ -43,7 +43,8 @@ library
43 , Katip.Scribes.Handle
43 , Katip.Scribes.Handle
44 , Katip.Scribes.Handle.FileOwner
44 , Katip.Scribes.Handle.FileOwner
45
45
46− default-extensions: DeriveGeneric
46+ default-extensions: CPP
47+ , DeriveGeneric
47 , FlexibleContexts
48 , FlexibleContexts
48 , GeneralizedNewtypeDeriving
49 , GeneralizedNewtypeDeriving
49 , LambdaCase
50 , LambdaCase
@@ -72,7 +73,7 @@ library
72 , safe-exceptions >= 0.1.0.0
73 , safe-exceptions >= 0.1.0.0
73 , scientific >= 0.3.3.0
74 , scientific >= 0.3.3.0
74 , semigroups
75 , semigroups
75− , stm >= 2.4 && < 2.5
76+ , stm >= 2.4
76 , string-conv >= 0.1
77 , string-conv >= 0.1
77 , template-haskell >= 2.8
78 , template-haskell >= 2.8
78 , text >= 0.11
79 , text >= 0.11
katip/src/Katip/Scribes/Handle/FileOwner.hs+15−4
@@ -14,6 +14,11 @@ import GHC.IO.Handle
14import GHC.IO.Handle.FD
14import GHC.IO.Handle.FD
15import GHC.IO.IOMode
15import GHC.IO.IOMode
16
16
17+#if MIN_VERSION_stm(2,5,0)
18+import Numeric.Natural
19+#endif
20+
21+
17-- | File owner struct writing data to the file
22-- | File owner struct writing data to the file
18-- sequentially. Automatic buffer flushing and log rotating.
23-- sequentially. Automatic buffer flushing and log rotating.
19data FileOwner = FileOwner
24data FileOwner = FileOwner
@@ -23,16 +28,22 @@ data FileOwner = FileOwner
23 -- ^ Wait for to be sure that worker thread is closed.
28 -- ^ Wait for to be sure that worker thread is closed.
24 }
29 }
25
30
31+#if MIN_VERSION_stm(2,5,0)
32+type QueueLen = Natural
33+#else
34+type QueueLen = Int
35+#endif
36+
26data FileOwnerSettings = FileOwnerSettings
37data FileOwnerSettings = FileOwnerSettings
27 { fosDebounceFreq :: Maybe Int
38 { fosDebounceFreq :: Maybe Int
28− , fosDataQueueLen :: Int
39+ , fosDataQueueLen :: QueueLen
29− , fosControlQueueLen :: Int
40+ , fosControlQueueLen :: QueueLen
30 }
41 }
31
42
32defaultFileOwnerSettings :: FileOwnerSettings
43defaultFileOwnerSettings :: FileOwnerSettings
33defaultFileOwnerSettings = FileOwnerSettings
44defaultFileOwnerSettings = FileOwnerSettings
34− { fosDebounceFreq = Just 200000 -- every 200ms
45+ { fosDebounceFreq = Just 200000 -- every 200ms
35− , fosDataQueueLen = 1000
46+ , fosDataQueueLen = 1000
36 , fosControlQueueLen = 100
47 , fosControlQueueLen = 100
37 }
48 }
38
49
stack-old.yamlnew file+21
@@ -0,0 +1,21 @@
1+nix:
2+ packages:
3+ - zlib
4+resolver: lts-12.26
5+packages:
6+ - katip
7+ - katip-elasticsearch
8+ - katip-datadog
9+ - katip-logzio
10+extra-deps:
11+ - bloodhound-0.16.0.0
12+ - unliftio-core-0.1.2.0
13+flags:
14+ katip:
15+ lib-Werror: true
16+ katip-elasticsearch:
17+ lib-Werror: true
18+ katip-datadog:
19+ lib-Werror: true
20+ katip-logzio:
21+ lib-Werror: true
stack.yaml+5−1
@@ -1,14 +1,18 @@
1nix:
1nix:
2 packages:
2 packages:
3 - zlib
3 - zlib
4−resolver: lts-12.26
4+resolver: lts-13.21
5packages:
5packages:
6 - katip
6 - katip
7 - katip-elasticsearch
7 - katip-elasticsearch
8 - katip-datadog
8 - katip-datadog
9 - katip-logzio
9 - katip-logzio
10extra-deps:
10extra-deps:
11+ - binary-0.8.7.0
11 - bloodhound-0.16.0.0
12 - bloodhound-0.16.0.0
13+ - containers-0.5.11.0
14+ - hedgehog-1.0
15+ - tasty-hedgehog-1.0.0.1
12 - unliftio-core-0.1.2.0
16 - unliftio-core-0.1.2.0
13flags:
17flags:
14 katip:
18 katip: