eventuo11y-json-0.3.0.2: aeson-based rendering for eventuo11y
CopyrightCopyright 2022 Shea Levy.
LicenseApache-2.0
Maintainershea@shealevy.com
Safe HaskellSafe-Inferred
LanguageHaskell2010

Observe.Event.Render.JSON.Handle

Contents

Description

 
Synopsis

Documentation

jsonHandleBackend Source #

Arguments

:: Exception stex 
=> Handle

Where to write Events.

-> RenderExJSON stex

Render a structured exception to JSON

-> RenderSelectorJSON s

Render a selector, and the fields of Events selected by it, to JSON

-> IO (EventBackend IO JSONRef s) 

An EventBackend which posts events to a given Handle as JSON.

Each Event is posted as a single line, as it's completed. As a result, child events will typically be posted before their parents (though still possible to correlate via event IDs).

The EventBackend must be the exclusive writer to the Handle while any events are live, but it does not hClose it itself.

simpleJsonStderrBackend :: RenderSelectorJSON s -> IO (EventBackend IO JSONRef s) Source #

An EventBackend which posts events to stderr as JSON.

Each Event is posted as a single line, as it's completed. As a result, child events will typically be posted before their parents (though still possible to correlate via event IDs).

Any instrumented Exceptions descended from SomeJSONException will be structurally rendered.

The EventBackend must be the exclusive writer to stderr while any events are live, but it does not hClose it itself.

Internals

newtype JSONRef Source #

The reference type for EventBackends generated by jsonHandleBackend.

Only expected to be used by type inference or by code implementing other backends using this one.

Constructors

JSONRef UUID 

Instances

Instances details
ToJSON JSONRef Source # 
Instance details

Defined in Observe.Event.Render.JSON.Handle

newJSONEvent Source #

Arguments

:: Exception stex 
=> (Object -> IO ())

Emit the final Value. This will be called at most once.

-> RenderExJSON stex 
-> RenderFieldJSON f 
-> Maybe JSONRef

Parent

-> [JSONRef]

Causes

-> [f]

Initial fields

-> IO (Event IO JSONRef f) 

Create a new Event in a jsonHandleBackend.