Safe Haskell | None |
---|---|
Language | Haskell2010 |
Logs are structured data that occur over the lifetime of a span.
Synopsis
- data LogRecord = LogRecord {}
- logTime :: Lens' LogRecord UTCTime
- logFields :: Lens' LogRecord (NonEmpty LogField)
- data LogField where
- logFieldLabel :: LogField -> Text
- logFieldEncoding :: LogField -> Encoding
- logFieldValue :: LogField -> Value
- type LogFieldsFormatter = forall t. Foldable t => t LogField -> Builder
- jsonAssoc :: LogFieldsFormatter
- jsonMap :: LogFieldsFormatter
Documentation
A single entry into a Spans
logs. Occurs at a single time and contains multiple
(one or more) entries.
Since: 0.1.0.0
A piece of data in a LogRecord
. Conceptually a key:value pair with a few
distinguished keys. More info about the distinguished keys in the OpenTracing spec
Since: 0.1.0.0
LogField :: Show a => Text -> a -> LogField | A generic key:value pair entry into a |
Event :: Text -> LogField | A stable identifier for some notable moment in the lifetime of a Span. |
Message :: Text -> LogField | A concise, human-readable, one-line message explaining the event. |
Stack :: CallStack -> LogField | A stack trace in platform-conventional format |
ErrKind :: Text -> LogField | The type or "kind" of an error (only for event="error" logs). |
ErrObj :: Exception e => e -> LogField | The actual error exception |
logFieldLabel :: LogField -> Text Source #
Retrieve the label of a log field. Distinguished LogField
s have predefined keys.
Since: 0.1.0.0
logFieldEncoding :: LogField -> Encoding Source #
logFieldValue :: LogField -> Value Source #
jsonAssoc :: LogFieldsFormatter Source #
A log formatter that encodes each LogField
as a single JSON object.
>>>
BS.hPutBuilder stdout $ jsonAssoc [Event "e", LogField @Text "key" "value"]
[{"event":"\"e\""},{"key":"\"value\""}]
Since: 0.1.0.0
jsonMap :: LogFieldsFormatter Source #
A log formatter that encodes each LogField
as an entry in a shared JSON object
>>>
BS.hPutBuilder stdout $ jsonMap [Event "e", LogField @Text "key" "value"]
{"event":"e","key":"\"value\""}
Since: 0.1.0.0