opentracing-0.3.0: OpenTracing for Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

OpenTracing.Log

Description

Logs are structured data that occur over the lifetime of a span.

Synopsis

Documentation

data LogRecord Source #

A single entry into a Spans logs. Occurs at a single time and contains multiple (one or more) entries.

Since: 0.1.0.0

Instances

Instances details
Show LogRecord Source # 
Instance details

Defined in OpenTracing.Log

data LogField where Source #

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

Constructors

LogField :: Show a => Text -> a -> LogField

A generic key:value pair entry into a LogRecord

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

Instances

Instances details
Show LogField Source # 
Instance details

Defined in OpenTracing.Log

logFieldLabel :: LogField -> Text Source #

Retrieve the label of a log field. Distinguished LogFields have predefined keys.

Since: 0.1.0.0

type LogFieldsFormatter = forall t. Foldable t => t LogField -> Builder 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