git.iko.soy/typeable/control-logger
on master help sign in
Moved Control.Logger.Google (#4847)
commitc91a56a3c3b9104ff32cfe6f2a75964cf39d12b2 authoriko <ilyakooo0@gmail.com> dateTue 4 Aug 2020, 22:50 (6 years ago) parentcb98189
2 files changed−25
control-logger.cabal−2 src/Control/Logger/Google.hs−23
control-logger.cabal−2
@@ -12,7 +12,6 @@ library
1212 exposed-modules: Control.Logger
1313 Control.Logger.Katip
1414 Control.Logger.Katip.Scribes.Reopenable
15− Control.Logger.Google
1615 Control.Logger.Katip.Utils
1716 Control.Logger.Orphans
1817 exposed-modules: Control.Logger.Internal
@@ -36,7 +35,6 @@ library
3635 build-depends: katip
3736 , katip-elasticsearch
3837 , optparse-applicative
39− , gogol
4038 default-language: Haskell2010
4139 default-extensions: RankNTypes
4240 DataKinds
src/Control/Logger/Google.hsdeleted−23
@@ -1,23 +0,0 @@
1−module Control.Logger.Google
2− ( toGoogleLogger
3− ) where
4−
5−import Control.Logger.Internal
6−import qualified Data.ByteString.Builder as B
7−import qualified Data.ByteString.Lazy as BS
8−import qualified Data.Text.Encoding as T
9−import qualified Data.Text.Encoding.Error as T
10−import qualified Network.Google as G
11−
12−
13−toGoogleLogger :: Logger -> G.Logger
14−toGoogleLogger logger level s = case logLevelToSeverity level of
15− Nothing -> return ()
16− Just sev -> logMsgWith logger sev
17− $ T.decodeUtf8With (T.replace '?') . BS.toStrict . B.toLazyByteString $ s
18−
19−logLevelToSeverity :: G.LogLevel -> Maybe LogSeverity
20−logLevelToSeverity G.Info = Just Info
21−logLevelToSeverity G.Debug = Just Debug
22−logLevelToSeverity G.Error = Just Error
23−logLevelToSeverity G.Trace = Nothing