Copyright | Copyright 2022 Shea Levy. |
---|---|
License | Apache-2.0 |
Maintainer | shea@shealevy.com |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Instrumentors will need to provide instances of RenderSelectorJSON
and RenderFieldJSON
for their domain-specific types to use their
Event
s with JSON-consuming EventBackend
s.
Synopsis
- type RenderSelectorJSON sel = forall f. sel f -> (Key, RenderFieldJSON f)
- type RenderFieldJSON field = field -> (Key, Value)
- type RenderExJSON stex = stex -> Value
- renderJSONException :: RenderExJSON SomeJSONException
- data SomeJSONException = forall e.(Exception e, ToJSON e) => SomeJSONException e
- jsonExceptionToException :: (Exception e, ToJSON e) => e -> SomeException
- jsonExceptionFromException :: Exception e => SomeException -> Maybe e
- renderDynamicEventSelectorJSON :: RenderSelectorJSON DynamicEventSelector
- renderDynamicFieldJSON :: RenderFieldJSON DynamicField
Documentation
type RenderSelectorJSON sel = forall f. sel f -> (Key, RenderFieldJSON f) Source #
A function to render a given selector, its fields, as JSON.
The Key
is the event name/category.
type RenderFieldJSON field = field -> (Key, Value) Source #
Rendering structured exceptions
type RenderExJSON stex = stex -> Value Source #
A function to render a given structured exception to JSON.
SomeJSONException
renderJSONException :: RenderExJSON SomeJSONException Source #
Render a SomeJSONException
to JSON.
It is not necessary to use SomeJSONException
for the base of your
structured exceptions in a JSON backend, so long as you provide a
RenderExJSON
for your base exception type.
data SomeJSONException Source #
A possible base type for structured exceptions renderable to JSON.
It is not necessary to use SomeJSONException
for the base of your
structured exceptions in a JSON backend, so long as you provide a
RenderExJSON
for your base exception type.
forall e.(Exception e, ToJSON e) => SomeJSONException e |
Instances
Exception SomeJSONException Source # | |
Defined in Observe.Event.Render.JSON | |
Show SomeJSONException Source # | |
Defined in Observe.Event.Render.JSON showsPrec :: Int -> SomeJSONException -> ShowS # show :: SomeJSONException -> String # showList :: [SomeJSONException] -> ShowS # |
jsonExceptionToException :: (Exception e, ToJSON e) => e -> SomeException Source #
Used to create sub-classes of SomeJSONException
.
jsonExceptionFromException :: Exception e => SomeException -> Maybe e Source #
Used to create sub-classes of SomeJSONException
.
Observe.Event.Dynamic support
renderDynamicEventSelectorJSON :: RenderSelectorJSON DynamicEventSelector Source #
Render a DynamicEventSelector
and all its sub-fields.