Skip to content

@graphty/graphty-element / index / defineLogDestination

Function: defineLogDestination() ​

defineLogDestination(definition, options?): () => void

Defined in: graphty-element/src/simple/defineLogDestination.ts:254

Register a log destination from a plain definition object, and attach it unless it says attach: false.

Parameters ​

definition ​

LogDestinationDefinition

The id, the level and categories it takes, and write.

options? ​

RegisterOptions

Whether a collision with an existing registration throws instead of replacing.

Returns ​

A function that detaches the destination.

() => void

Throws ​

A GraphtyError E_BAD_COMMAND naming the member at fault, or E_DUPLICATE_PLUGIN for an id the element keeps for its own destinations.