| Copyright | (c) 2023 GYELD GMBH |
|---|---|
| License | Apache 2.0 |
| Maintainer | support@geniusyield.co |
| Stability | develop |
| Safe Haskell | None |
| Language | Haskell2010 |
GeniusYield.Types.Logging
Description
Synopsis
- data GYLogSeverity
- newtype GYLogVerbosity = GYLogVerbosity Verbosity
- data GYLogNamespace
- data GYLogScribeType
- data GYLogScribeConfig = GYLogScribeConfig {}
- newtype LogSrc = LogSrc URI
- logSeverityToKatip ∷ GYLogSeverity → Severity
- logVerbosityToKatip ∷ GYLogVerbosity → Verbosity
- logNamespaceToKatip ∷ GYLogNamespace → Namespace
- prettyNamespace ∷ GYLogNamespace → String
- mkLogEnv ∷ GYLogNamespace → [GYLogScribeConfig] → IO LogEnv
Severity
data GYLogSeverity #
>>>LBS8.putStrLn $ Aeson.encode GYDebug"Debug"
>>>LBS8.putStrLn $ Aeson.encode GYInfo"Info"
>>>LBS8.putStrLn $ Aeson.encode GYWarning"Warning"
>>>LBS8.putStrLn $ Aeson.encode GYError"Error"
Instances
Verbosity
newtype GYLogVerbosity #
>>>Aeson.eitherDecode @GYLogVerbosity "\"V0\""Right (GYLogVerbosity V0)
>>>Aeson.eitherDecode @GYLogVerbosity "\"V1\""Right (GYLogVerbosity V1)
>>>Aeson.eitherDecode @GYLogVerbosity "\"V2\""Right (GYLogVerbosity V2)
>>>Aeson.eitherDecode @GYLogVerbosity "\"V3\""Right (GYLogVerbosity V3)
>>>Aeson.eitherDecode @GYLogVerbosity "\"V4\""Left "Error in $: Invalid Verbosity V4"
Constructors
| GYLogVerbosity Verbosity |
Instances
Namespace
data GYLogNamespace #
>>>"My" <> "Namespace" :: GYLogNamespaceGYLogNamespace (Namespace {unNamespace = ["My","Namespace"]})
Instances
Scribe Configuration
data GYLogScribeType #
Constructors
| GYStdErrScribe | |
| GYGCPScribe | |
| GYCustomSourceScribe !LogSrc |
Instances
| Eq GYLogScribeType # | |
Defined in GeniusYield.Types.Logging Methods (==) ∷ GYLogScribeType → GYLogScribeType → Bool # (/=) ∷ GYLogScribeType → GYLogScribeType → Bool # | |
| Ord GYLogScribeType # | |
Defined in GeniusYield.Types.Logging Methods compare ∷ GYLogScribeType → GYLogScribeType → Ordering # (<) ∷ GYLogScribeType → GYLogScribeType → Bool # (<=) ∷ GYLogScribeType → GYLogScribeType → Bool # (>) ∷ GYLogScribeType → GYLogScribeType → Bool # (>=) ∷ GYLogScribeType → GYLogScribeType → Bool # | |
| Show GYLogScribeType # | |
Defined in GeniusYield.Types.Logging Methods showsPrec ∷ Int → GYLogScribeType → ShowS # show ∷ GYLogScribeType → String # showList ∷ [GYLogScribeType] → ShowS # | |
| FromJSON GYLogScribeType # |
|
Defined in GeniusYield.Types.Logging Methods parseJSON ∷ Value → Parser GYLogScribeType # parseJSONList ∷ Value → Parser [GYLogScribeType] # | |
| ToJSON GYLogScribeType # |
|
Defined in GeniusYield.Types.Logging Methods toJSON ∷ GYLogScribeType → Value # toEncoding ∷ GYLogScribeType → Encoding # toJSONList ∷ [GYLogScribeType] → Value # toEncodingList ∷ [GYLogScribeType] → Encoding # | |
data GYLogScribeConfig #
Constructors
| GYLogScribeConfig | |
Instances
Constructors
| LogSrc URI |
Instances
| Eq LogSrc # | |
| Ord LogSrc # | |
| Show LogSrc # | |
| IsString LogSrc # | |
Defined in GeniusYield.Types.Logging Methods fromString ∷ String → LogSrc # | |
| FromJSON LogSrc # | |
Defined in GeniusYield.Types.Logging | |
| ToJSON LogSrc # | |
Defined in GeniusYield.Types.Logging Methods toEncoding ∷ LogSrc → Encoding # toJSONList ∷ [LogSrc] → Value # toEncodingList ∷ [LogSrc] → Encoding # | |
Utilities
logSeverityToKatip ∷ GYLogSeverity → Severity #
logVerbosityToKatip ∷ GYLogVerbosity → Verbosity #
logNamespaceToKatip ∷ GYLogNamespace → Namespace #
mkLogEnv ∷ GYLogNamespace → [GYLogScribeConfig] → IO LogEnv #