Skip to content

@graphty/graphty-element / extend / LogDestinationDefinition

Interface: LogDestinationDefinition ​

Defined in: graphty-element/src/simple/types.ts:419

What defineLogDestination takes: an id and write.

Properties ​

attach? ​

readonly optional attach?: boolean

Defined in: graphty-element/src/simple/types.ts:438

Attach now (the default) or only register, for a configuration to turn on by id.


categories? ​

readonly optional categories?: readonly string[]

Defined in: graphty-element/src/simple/types.ts:429

Only records whose category contains one of these segments.


description? ​

readonly optional description?: string

Defined in: graphty-element/src/simple/types.ts:425

One sentence for the catalogue.


id ​

readonly id: string

Defined in: graphty-element/src/simple/types.ts:421

Permanent id: lower case, hyphenated, vendor-prefixed ("acme-telemetry"). Defining it again replaces the earlier one.


level? ​

readonly optional level?: LogLevelName

Defined in: graphty-element/src/simple/types.ts:427

The least severe level delivered. Default "warn".


name? ​

readonly optional name?: string

Defined in: graphty-element/src/simple/types.ts:423

What a destination picker shows. Default: the id in sentence case.


write ​

readonly write: (record) => void | Promise<unknown>

Defined in: graphty-element/src/simple/types.ts:436

May return a promise (a fetch); the element queues, orders, retries and flushes. A rejection, or a promise that resolves to a fetch Response whose ok is false, counts as a failed send. Promise<unknown>, so fetch(...) (a Promise<Response>) can be returned as it is.

Parameters ​

record ​

PlainLogRecord

Returns ​

void | Promise<unknown>